Home | History | Annotate | Download | only in intltest

Lines Matching refs:dateFormat

42 DateFormatRoundTripTest::DateFormatRoundTripTest() : dateFormat(0) {
46 delete dateFormat;
139 const Locale *avail = DateFormat::getAvailableLocales(locCount);
140 logln("DateFormat available locales: %d", locCount);
190 static const char *styleName(DateFormat::EStyle s)
194 case DateFormat::SHORT: return "SHORT";
195 case DateFormat::MEDIUM: return "MEDIUM";
196 case DateFormat::LONG: return "LONG";
197 case DateFormat::FULL: return "FULL";
198 // case DateFormat::DEFAULT: return "DEFAULT";
199 case DateFormat::DATE_OFFSET: return "DATE_OFFSET";
200 case DateFormat::NONE: return "NONE";
201 case DateFormat::DATE_TIME: return "DATE_TIME";
234 for(style = DateFormat::FULL; style <= DateFormat::SHORT; ++style) {
236 logln("Testing style " + UnicodeString(styleName((DateFormat::EStyle)style)));
237 DateFormat *df = DateFormat::createDateInstance((DateFormat::EStyle)style, loc);
239 errln(UnicodeString("Could not DF::createDateInstance ") + UnicodeString(styleName((DateFormat::EStyle)style)) + " Locale: " + loc.getDisplayName(temp));
247 for(style = DateFormat::FULL; style <= DateFormat::SHORT; ++style) {
249 logln("Testing style " + UnicodeString(styleName((DateFormat::EStyle)style)));
250 DateFormat *df = DateFormat::createTimeInstance((DateFormat::EStyle)style, loc);
252 errln(UnicodeString("Could not DF::createTimeInstance ") + UnicodeString(styleName((DateFormat::EStyle)style)) + " Locale: " + loc.getDisplayName(temp));
260 for(int32_t dstyle = DateFormat::FULL; dstyle <= DateFormat::SHORT; ++dstyle) {
261 for(int32_t tstyle = DateFormat::FULL; tstyle <= DateFormat::SHORT; ++tstyle) {
263 logln("Testing dstyle" + UnicodeString(styleName((DateFormat::EStyle)dstyle)) + ", tstyle" + UnicodeString(styleName((DateFormat::EStyle)tstyle)) );
264 DateFormat *df = DateFormat::createDateTimeInstance((DateFormat::EStyle)dstyle, (DateFormat::EStyle)tstyle, loc);
266 dataerrln(UnicodeString("Could not DF::createDateTimeInstance ") + UnicodeString(styleName((DateFormat::EStyle)dstyle)) + ", tstyle" + UnicodeString(styleName((DateFormat::EStyle)tstyle)) + "Locale: " + loc.getDisplayName(temp));
276 void DateFormatRoundTripTest::test(DateFormat *fmt, const Locale &origLocale, UBool timeOnly)
280 errln("DateFormat wasn't a SimpleDateFormat");
486 if (dateFormat == 0) {
487 dateFormat = new SimpleDateFormat((UnicodeString)"EEE MMM dd HH:mm:ss.SSS zzz yyyy G", ec);
488 if (U_FAILURE(ec) || dateFormat == 0) {
490 delete dateFormat;
491 dateFormat = 0;
496 dateFormat->format(d, fgStr);