Home | History | Annotate | Download | only in intltest

Lines Matching refs:format

284          * Format the output.
288 sdf->format(today,fmtOffset, pos);
376 logln(*s + " P> " + ((DateFormat*)fullFmt)->format(d, str));
541 logln((UnicodeString)" Result = " + df->format(aug13, buf.remove()));
547 df->format(aug13, buf, pos);
562 df->format(aug13, buf, &posIter, status);
578 dateFormats[0]->format(aug13, buf, NULL, status);
590 * General parse/format tests. Add test cases as needed.
596 // Milliseconds are left-justified, since they format as fractions of a second
635 DateFormatTest::tryPat994(SimpleDateFormat* format, const char* pat, const char* str, UDate expected)
641 format->applyPattern(pat);
642 UDate date = format->parse(str, status);
651 ((DateFormat*)format)->format(date, f);
653 logln((UnicodeString)" format -> " + f);
679 UnicodeString format("yyyyMMddHHmmssSSS");
682 SimpleDateFormat *formatter = new SimpleDateFormat(format, status);
689 ((DateFormat*)formatter)->format(date1, now);
694 else ((DateFormat*)formatter)->format(date2, then);
739 ((Format*)fmt)->parseObject(str, o, status);
748 UnicodeString formatted; ((Format*)fmt)->format(o, formatted, status);
774 UnicodeString juneStr; fmt->format(june, juneStr);
775 UnicodeString julyStr; fmt->format(july, julyStr);
777 logln((UnicodeString)"format(June 15 1997) = " + juneStr);
779 UnicodeString s; fmt->format(d, s);
783 logln((UnicodeString)"format(July 15 1997) = " + julyStr);
785 fmt->format(d, s);
867 UnicodeString formatResult; (*(DateFormat*)&sdf).format(d, formatResult);
868 logln((UnicodeString)" format -> " + formatResult);
873 UnicodeString format2; (*(DateFormat*)&sdf).format(d2, format2);
874 logln((UnicodeString)" format -> " + format2);
899 UnicodeString dateString; ((DateFormat*)formatter)->format(currentTime_1, dateString);
901 logln((UnicodeString)"format(" + dateToString(currentTime_1) + ") = " + dateString);
950 UnicodeString format;
956 full->format(when, format);
957 logln(prefix + "OK: " + format);
958 if (0!=format.compareBetween(0, expected.length(), expected, 0, expected.length()))
959 errln((UnicodeString)"FAIL: Parse \"" + text + "\", pattern \"" + pattern + "\", expected " + expected + " got " + format);
1081 ((DateFormat*)dateParse)->format(date, result);
1162 UnicodeString temp; formatter->format(date, temp);
1213 // format every way
1215 UnicodeString("simple format: "), UnicodeString("04/04/97 23:00 GMT"),
1217 UnicodeString("full format: "), UnicodeString("Friday, April 4, 1997 11:00:00 o'clock PM GMT"),
1219 UnicodeString("long format: "), UnicodeString("April 4, 1997 11:00:00 PM GMT"),
1221 UnicodeString("default format: "), UnicodeString("04-Apr-97 11:00:00 PM"),
1223 UnicodeString("short format: "), UnicodeString("4/4/97 11:00 PM"),
1236 result = fmt->format(greenwichdate, result);
1279 dfFrench->format(testDate, out);
1284 dfUS->format(testDate, out);
1317 /* Create a full format for output */
1361 full->format(when, str);
1471 f.format((UDate)0, out, pos);
1473 // The bug is that the call to format() will crash. By not
1486 fmt.format(date, str);
1807 gotfmt.format(got, gotstr);
1817 // This only happens if expected is in wrong format --
1850 * 'f': Format date [i+2] (as parsed using pattern [0]) and expect string [i+3].
1854 * 'F': Format date [i+2] and expect string [i+3],
1859 * 'f': Format date [i+3] and expect string [i+4].
1890 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1892 fmt.format(date, str.remove()));
1900 univ.format(date, str.remove()),
1901 univ.format(parsedate, str2.remove()));
1914 univ.format(date, str.remove()),
1915 univ.format(parsedate, str2.remove()));
1919 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1921 fmt.format(date, str.remove()));
1929 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1931 fmt.format(date, str.remove()));
1936 univ.format(date, str.remove()),
1937 univ.format(parsedate, str2.remove()));
1961 * Format date [i+1] and expect string [i+2].
1991 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1993 fmt.format(date, str.remove()));
2077 logln("cross format/parse tests"); // Note: We no longer support cross format/parse
2104 formats[j].format(d, test);
2110 errln((UnicodeString)"FAIL: format " + k +
2111 " incorrectly parsed output of format " + j +
2115 logln((UnicodeString)"OK: format " + k + " parsed ok");
2118 errln((UnicodeString)"FAIL: format " + k +
2119 " could not parse output of format " + j +
2130 // Note: We no longer support cross style format/parse
2214 univ.format(d, result);
2293 full->format(*c, expect, pos); // expected = normal full
2296 fullrelative ->format(*c, result, pos);
2297 en_full ->format(*c, normalResult, pos);
2300 errln("FAIL: Relative Format ["+bannerStr+"] of "+normalResult+" failed, expected "+expect+" but got " + result);
2302 logln("PASS: Relative Format ["+bannerStr+"] of "+normalResult+" got " + result);
2310 UnicodeString parseFormat; // parse rel->format full
2311 en_full->format(d, parseFormat, status);
2314 en_full->format(*c, origFormat, pos);
2359 full->format(now, result1, status);
2360 Format *fullClone = full->clone();
2365 fullClone->format(now, result2, status);
2389 full->format(now, result1, status);
2390 Format *fullClone = full->clone();
2395 fullClone->format(now, result2, status);
3248 fmt.format(*cal,result,pos);
3305 formatters[i]->format(*calendars[i], buf, fpos);
3319 formatters[i]->format(*calendars[j], buf, fpos);
3321 errln((UnicodeString)"FAIL: Different format result with a different calendar for the same time -"
3409 str1 = fmt1->format(dt1, str1);
3416 str11 = fmt1->format(dt11, str11);
3433 str2 = fmt2->format(dt2, str2);
3440 str22 = fmt2->format(dt22, str22);
3457 str3 = fmt3->format(dt3, str3);
3464 str33 = fmt3->format(dt33, str33);
3481 str4 = fmt4->format(dt4, str4);
3488 str44 = fmt4->format(dt44, str44);
3523 strf = fmtf->format(dt, strf);
3524 strl = fmtl->format(dt, strl);
3525 strm = fmtm->format(dt, strm);
3526 strs = fmts->format(dt, strs);
3570 // Test case for localized GMT format parsing
3571 // with no delimitters in offset format (Chinese locale)
3605 fmt->format(d1, s1);
3606 fmt->format(d2, s2);
3683 formatter->format(date1, formatted);
3725 // format date back to string
3727 out = fmt1->format(dt1, out);
3753 sdf->format(thedate,result,pos);
3766 usf->format(parsedate,parsedres,pos);
3767 usf->format
3932 dmft->format(*rootChineseCalendar, result, fpos);
3934 errln( UnicodeString("FAIL: Chinese calendar format for locale ") + UnicodeString(itemPtr->locale) + ", style " + itemPtr->style +
4017 sdmft->format(*cal, result, pos);
4019 errln(UnicodeString("FAIL: format for locale ") + UnicodeString(itemPtr->locale) +
4035 // test item for a particular locale + calendar and date format
4045 // test item giving locale + calendar, date format, and CalAndFmtTestItems
4054 // test items for he@calendar=hebrew, long date format
4089 dfmt->format(*cal, result, fpos);
4091 errln( UnicodeString("FAIL: date format for locale ") + UnicodeString(itemPtr->locale) + ", style " + itemPtr->style +
4130 LocalPointer<DateFormat> format(DateFormat::createDateTimeInstance(dateStyle, timeStyle, locale));
4133 if (format.isNull()) {
4137 format->format(TEST_DATE, formattedString);
4139 if (!showParse(*format, formattedString)) {
4144 formattedString = dateFormat->format(TEST_DATE, ds) + " " + timeFormat->format(TEST_DATE, ts);
4145 if (!showParse(*format, formattedString)) {
4151 if (!showParse(*format, plusDot)) {
4158 if (!showParse(*format, minusDot)) {
4167 UBool DateFormatTest::showParse(DateFormat &format, const UnicodeString &formattedString) {
4169 UDate parsed = format.parse(formattedString, parsePosition);
4172 static_cast<SimpleDateFormat &>(format).toPattern(pattern);