Lines Matching refs:UnicodeString
31 virtual UnicodeString& format( double number, in format()
32 UnicodeString& toAppendTo, in format()
40 virtual UnicodeString& format(const Formattable& obj, in format()
41 UnicodeString& toAppendTo, in format()
49 virtual UnicodeString& format( double /* number */, in format()
50 UnicodeString& toAppendTo, in format()
63 virtual void parse( const UnicodeString& /* text */, in parse() argument
70 virtual void parse( const UnicodeString& text, in parse()
79 virtual UnicodeString& format(int32_t, in format()
80 UnicodeString& foo, in format()
84 virtual UnicodeString& format(int64_t, in format()
85 UnicodeString& foo, in format()
89 virtual void applyPattern(const UnicodeString&, UParseError&, UErrorCode&){ in applyPattern() argument
104 #define CASE(id,test) case id: name = #test; if (exec) { logln(#test "---"); logln((UnicodeString)"…
183 NumberFormatRegressionTest::failure(UErrorCode status, const UnicodeString& msg, const Locale& l, U… in failure()
187 dataerrln(UnicodeString("FAIL: ", "") + msg in failure()
188 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l.… in failure()
190 errcheckln(status, UnicodeString("FAIL: ", "") + msg in failure()
191 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l.… in failure()
200 NumberFormatRegressionTest::failure(UErrorCode status, const UnicodeString& msg, const char *l, UBo… in failure()
204 dataerrln(UnicodeString("FAIL: ", "") + msg in failure()
205 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l,… in failure()
207 errcheckln(status, UnicodeString("FAIL: ", "") + msg in failure()
208 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l,… in failure()
217 NumberFormatRegressionTest::failure(UErrorCode status, const UnicodeString& msg, UBool possibleData… in failure()
221 dataerrln(UnicodeString("FAIL: ", "") + msg in failure()
222 + UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "")); in failure()
224 errcheckln(status, UnicodeString("FAIL: ", "") + msg in failure()
225 + UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "")); in failure()
236 inline UnicodeString str(const char *input) in str()
293 UnicodeString sBuf1; in Test4088161()
295 logln(UnicodeString("d = ") + d); in Test4088161()
296 logln(UnicodeString("maxFractionDigits = ") + df->getMaximumFractionDigits()); in Test4088161()
300 UnicodeString sBuf2; in Test4088161()
302 logln(UnicodeString("maxFractionDigits = ") + df->getMaximumFractionDigits()); in Test4088161()
327 UnicodeString buf1; in Test4087245()
328 UnicodeString buf2; in Test4087245()
330 logln(UnicodeString("format(") + n + ") = " + in Test4087245()
332 …symbols->setSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol, UnicodeString((UChar)0x70)); // … in Test4087245()
333 logln(UnicodeString("format(") + n + ") = " + in Test4087245()
356 UnicodeString buffer; in Test4087535()
382 UnicodeString sBuf; in Test4088503()
408 logln(UnicodeString(" VALUE ") + returnfloat); in assignFloatValue()
417 UnicodeString stringValue; in assignFloatValue()
428 …errln(UnicodeString("FAIL: expected ") + returnfloat + ", got " + floatResult + " (" + stringValue… in assignFloatValue()
444 UnicodeString str; in Test4059870()
445 format->parse(UnicodeString("0"), result, status); in Test4059870()
490 UnicodeString out; in Test4071492()
494 UnicodeString expected("0.0016"); in Test4071492()
526 UnicodeString temp; in Test4086575()
532 nf->applyLocalizedPattern(UnicodeString("###,00;(###,00)"), status); in Test4086575()
550 UnicodeString pat(patChars, 19, 19); in Test4086575()
555 UnicodeString buffer; in Test4086575()
561 UnicodeString cc(c, 8, 8); in Test4086575()
570 UnicodeString cc1(c1, 10, 10); in Test4086575()
599 df->parse(UnicodeString("123.55456"), d, pos); in Test4068693()
601 UnicodeString dstr; in Test4068693()
606 if (dstr != UnicodeString("123.55456")) { in Test4068693()
607 errln(UnicodeString("Result -> ") + d.getDouble()); in Test4068693()
654 df->applyPattern(UnicodeString("#.#.#"), status); in Test4087251()
657 UnicodeString temp; in Test4087251()
710 logln(UnicodeString("d = ") + d); in Test4090504()
719 UnicodeString sb; in Test4090504()
726 logln(UnicodeString(" getMaximumFractionDigits() = ") + i); in Test4090504()
727 logln(UnicodeString(" formated: ") + df->format(d, sb, fp)); in Test4090504()
748 UnicodeString str("0.1234"); in Test4095713()
755 logln(UnicodeString("") + d1); in Test4095713()
757 errln(UnicodeString("Bug 4095713 test failed, new double value : ") + d2.getDouble()); in Test4095713()
794 DecimalFormat *dfFoo = new DecimalFormat(UnicodeString("000"), status); in Test4092480()
805 UnicodeString temp; in Test4092480()
806 if (dfFoo->toPattern(temp) != UnicodeString("#0000")) in Test4092480()
813 if (dfFoo->toPattern(temp) != UnicodeString("#000")) in Test4092480()
820 if (dfFoo->toPattern(temp) != UnicodeString("#000")) in Test4092480()
827 if (dfFoo->toPattern(temp) != UnicodeString("#0000")) in Test4092480()
862 UnicodeString decSep = sym->getSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol); in Test4087244()
863 UnicodeString monSep = sym->getSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol); in Test4087244()
870 UnicodeString str; in Test4087244()
873 UnicodeString monStr("1x23"); in Test4087244()
875 UnicodeString decStr("1x23"); in Test4087244()
878 logln(UnicodeString("OK: 1.23 -> \"") + str + "\" contains \"" + in Test4087244()
881 errln(UnicodeString("FAIL: 1.23 -> \"") + str + "\", should contain \"" + in Test4087244()
894 UnicodeString tempString; in Test4070798()
910 UnicodeString expectedDefault(chars1, 10, 10); in Test4070798()
911 UnicodeString expectedCurrency(chars2, 10, 10); in Test4070798()
912 UnicodeString expectedPercent(chars3, 10, 10); in Test4070798()
930 errln(UnicodeString("Failed:") + in Test4070798()
944 errln(UnicodeString("Failed:") + in Test4070798()
959 errln(UnicodeString("Failed:") + in Test4070798()
972 UnicodeString tempString; in Test4071005()
987 UnicodeString expectedDefault(chars1, 10, 10); in Test4071005()
988 UnicodeString expectedCurrency(chars2, 10, 10); in Test4071005()
989 UnicodeString expectedPercent(chars3, 10, 10); in Test4071005()
1002 errln(UnicodeString("Failed:") + in Test4071005()
1016 errln(UnicodeString("Failed:") + in Test4071005()
1030 errln(UnicodeString("Failed:") + in Test4071005()
1044 UnicodeString tempString; in Test4071014()
1050 UnicodeString expectedDefault("-5.789,988"); in Test4071014()
1051 UnicodeString expectedCurrency("5.789,99\\u00A0DM"); in Test4071014()
1052 UnicodeString expectedPercent("-578.999\\u00A0%"); in Test4071014()
1071 errln(UnicodeString("Failed:") + in Test4071014()
1085 errln(UnicodeString("Failed:") + in Test4071014()
1099 errln(UnicodeString("Failed:") + in Test4071014()
1112 UnicodeString tempString; in Test4071859()
1118 UnicodeString expectedDefault("-5.789,988"); in Test4071859()
1119 UnicodeString expectedCurrency("-ITL\\u00A05.790", -1, US_INV); in Test4071859()
1120 UnicodeString expectedPercent("-578.999%"); in Test4071859()
1136 errln(UnicodeString("Failed:") + in Test4071859()
1150 errln(UnicodeString("Failed:") + in Test4071859()
1164 errln(UnicodeString("Failed:") + in Test4071859()
1179 UnicodeString s("12.4"); in Test4093610()
1203 void NumberFormatRegressionTest::roundingTest(DecimalFormat *df, double x, UnicodeString& expected) in roundingTest()
1205 UnicodeString out; in roundingTest()
1208 logln(UnicodeString("") + x + " formats with 1 fractional digits to " + out); in roundingTest()
1227 UnicodeString temp; in Test4098741()
1253 UnicodeString tempString; in Test4074454()
1256 if (tempString != UnicodeString("3,456.78 p'ieces")) in Test4074454()
1288 DecimalFormat *fmt = new DecimalFormat(UnicodeString("000.0#0"), status); in Test4099404()
1290 errln(UnicodeString("Bug 4099404 failed applying illegal pattern \"000.0#0\"")); in Test4099404()
1297 fmt = new DecimalFormat(UnicodeString("0#0.000"), status); in Test4099404()
1312 DecimalFormat *sdf = new DecimalFormat(UnicodeString("#,##0"), status); in Test4101481()
1320 errln(UnicodeString("Minimum integer digits : ") + sdf->getMinimumIntegerDigits()); in Test4101481()
1330 DecimalFormat *fmt = new DecimalFormat(UnicodeString("#,#00.00"), status); in Test4052223()
1338 fmt->parse(UnicodeString("abc3"), num, status); in Test4052223()
1340 errln(UnicodeString("Bug 4052223 failed : can't parse string \"a\". Got ") /*+ num*/); in Test4052223()
1357 UnicodeString currency(fmt->getSymbol(DecimalFormatSymbols::kCurrencySymbol)); in Test4061302()
1358 UnicodeString intlCurrency(fmt->getSymbol(DecimalFormatSymbols::kIntlCurrencySymbol)); in Test4061302()
1359 UnicodeString monDecSeparator(fmt->getSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol)); in Test4061302()
1360 if (currency == UnicodeString("") || in Test4061302()
1361 intlCurrency == UnicodeString("") || in Test4061302()
1362 monDecSeparator == UnicodeString("")) in Test4061302()
1366 UnicodeString monDecSeparatorStr; in Test4061302()
1368 …logln((UnicodeString)"Before set ==> Currency : " + currency +(UnicodeString)" Intl Currency : " +… in Test4061302()
1369 fmt->setSymbol(DecimalFormatSymbols::kCurrencySymbol, UnicodeString("XYZ")); in Test4061302()
1370 fmt->setSymbol(DecimalFormatSymbols::kIntlCurrencySymbol, UnicodeString("ABC")); in Test4061302()
1371 …fmt->setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, UnicodeString((UChar)0x002A/*'*'*/)… in Test4061302()
1375 if (currency != UnicodeString("XYZ") || in Test4061302()
1376 intlCurrency != UnicodeString("ABC") || in Test4061302()
1377 monDecSeparator != UnicodeString((UChar)0x002A/*'*'*/)) { in Test4061302()
1393 DecimalFormat *fmt = new DecimalFormat(UnicodeString("#,##0.00"), status); in Test4062486()
1398 UnicodeString formatted; in Test4062486()
1403 …errln(UnicodeString("Format 1234.5 failed. Begin index: ") /*+ field.getBeginIndex() + " End index… in Test4062486()
1427 UnicodeString text("1.222,111"); in Test4108738()
1434 UnicodeString temp; in Test4108738()
1438 if (temp != UnicodeString("1.222")) in Test4108738()
1441 text = UnicodeString("1.222x111"); in Test4108738()
1447 if (temp != UnicodeString("1.222")) in Test4108738()
1468 UnicodeString buffer; in Test4106658()
1469 UnicodeString temp; in Test4106658()
1479 if (buffer != UnicodeString("-0")) // Corrected; see 4147706 in Test4106658()
1480 errln(UnicodeString("") + d1 + " is formatted as " + buffer); in Test4106658()
1483 if (buffer != UnicodeString("-0")) // Corrected; see 4147706 in Test4106658()
1484 errln(UnicodeString("") + d2 + " is formatted as " + buffer); in Test4106658()
1502 UnicodeString text("x"); in Test4106662()
1505 UnicodeString temp; in Test4106662()
1510 errln(UnicodeString("Test Failed: \"") + text + "\" is parsed as " /*+ num*/); in Test4106662()
1513 df = new DecimalFormat(UnicodeString("$###.00"), status); in Test4106662()
1515 df->parse(UnicodeString("$"), num, pos2); in Test4106662()
1517 errln(UnicodeString("Test Failed: \"$\" is parsed as ") /*+ num*/); in Test4106662()
1536 UnicodeString text("time 10:x"); in Test4114639()
1541 … errln(UnicodeString("Should return null but got : ") /*+ result*/); // Should be null; it isn't in Test4114639()
1570 UnicodeString temp; in Test4106664()
1578 logln(UnicodeString("expected: ") + buf); in Test4106664()
1596 UnicodeString bar(foo, 1, 1); in Test4106667()
1598 UnicodeString temp; in Test4106667()
1599 UnicodeString buffer; in Test4106667()
1610 if (buffer != UnicodeString("-0")) // Corrected; see 4147706 in Test4106667()
1611 errln(/*d + */UnicodeString(" is formatted as ") + buffer); in Test4106667()
1638 errln(UnicodeString("getMaximumIntegerDigits() returns ") + in Test4110936()
1675 UnicodeString pattern = numPat.getString(status); in Test4122840()
1679 UnicodeString foo(fo, 1, 1); in Test4122840()
1683 errln(UnicodeString("Currency format for ") + UnicodeString(locales[i].getName()) + in Test4122840()
1694 UnicodeString result1; in Test4122840()
1704 UnicodeString bar(ba, 1, 1); in Test4122840()
1712 UnicodeString buf(pattern); in Test4122840()
1745 UnicodeString result2; in Test4122840()
1749 errln("Results for " + (UnicodeString)(locales[i].getName()) + " differ: " + in Test4122840()
1776 UnicodeString temp; in Test4125885()
1778 UnicodeString rateString; in Test4125885()
1781 if (rateString != UnicodeString("012.34")) in Test4125885()
1790 if (rateString != UnicodeString("+012.34%")) in Test4125885()
1805 UnicodeString f; in Test4134034()
1808 if (f == UnicodeString("9.02")) in Test4134034()
1815 if (f == UnicodeString(".00")) in Test4134034()
1850 UnicodeString DATA [] = { in Test4134300()
1852 UnicodeString("#.00"), UnicodeString("1.20"), in Test4134300()
1853 UnicodeString("0.00"), UnicodeString("1.20"), in Test4134300()
1854 UnicodeString("00.00"), UnicodeString("01.20"), in Test4134300()
1855 UnicodeString("#0.0#"), UnicodeString("1.2"), in Test4134300()
1856 UnicodeString("#0.00"), UnicodeString("1.20") in Test4134300()
1860 UnicodeString result; in Test4134300()
1888 DecimalFormat *f = new DecimalFormat(UnicodeString(""), syms, status); in Test4140009()
1890 UnicodeString s; in Test4140009()
1893 if (s != UnicodeString("123.456")) in Test4140009()
1897 if (s != UnicodeString("-123.456")) in Test4140009()
1945 UnicodeString PATS [] = { in Test4145457()
1946 UnicodeString("#.00 'num''ber'"), UnicodeString("''#.00''") in Test4145457()
1952 UnicodeString out; in Test4145457()
1955 UnicodeString pat; in Test4145457()
1964 UnicodeString out2; in Test4145457()
1966 UnicodeString pat2; in Test4145457()
1979 logln(UnicodeString("Ok ") + pi + " x \"" + PATS[i] + "\" -> \"" + in Test4145457()
1984 errln(UnicodeString("Fail ") + pi + " x \"" + PATS[i] + "\" -> \"" + in Test4145457()
2008 UnicodeString pattern("#,###"); in Test4147295()
2015 errln(UnicodeString(" Minimum integer digits : ") + minIntDig); in Test4147295()
2016 UnicodeString temp; in Test4147295()
2017 errln(UnicodeString(" new pattern: ") + sdf->toPattern(temp)); in Test4147295()
2020 logln(UnicodeString(" Minimum integer digits : ") + minIntDig); in Test4147295()
2038 UnicodeString f1; in Test4147706()
2039 UnicodeString f2, temp; in Test4147706()
2052 if (f1 != UnicodeString("-0.0")) { in Test4147706()
2053 …errln(UnicodeString("") + d1 + UnicodeString(" x \"") + df->toPattern(temp) + "\" is formatted as … in Test4147706()
2055 if (f2 != UnicodeString("-0.0")) { in Test4147706()
2056 …errln(UnicodeString("") + d2 + UnicodeString(" x \"") + df->toPattern(temp) + "\" is formatted as … in Test4147706()
2096 UnicodeString s; in Test4162198()
2098 logln(UnicodeString("The number ") + dbl + " formatted to " + s); in Test4162198()
2140 UnicodeString s;
2147 logln(UnicodeString("") +
2177 UnicodeString s;
2184 logln(UnicodeString("") + a + " -> \"" + s + "\" -> " +
2187 errln(UnicodeString("") + a + " -> \"" + s + "\" -> " +
2222 errln(UnicodeString("FAIL: parse(\"-0.0\") returns ") + toString(n));
2245 UnicodeString s;
2250 UnicodeString exp(DATA[i+1]);
2252 errln(UnicodeString("FAIL: ") + DATA[i] + " -> " +
2284 UnicodeString pat(DATA[i+1]);
2285 UnicodeString exp(DATA[i+2]);
2288 UnicodeString out;
2292 logln(UnicodeString("Ok: ") + in + " x " + pat + " = " + out);
2294 errln(UnicodeString("FAIL: ") + in + " x " + pat + " = " + out +
2313 DecimalFormat fmt(UnicodeString("#"), sym, status);
2318 UnicodeString s;
2325 errln(UnicodeString("FAIL: -1 x (minus=^) -> ") + s +
2329 if (fmt.getNegativePrefix(s) != UnicodeString((UChar)0x5e)) {
2330 errln(UnicodeString("FAIL: (minus=^).getNegativePrefix -> ") +
2335 fmt.applyPattern(UnicodeString("#%"), status);
2341 errln(UnicodeString("FAIL: 0.25 x (percent=^) -> ") + s +
2345 if (fmt.getPositiveSuffix(s) != UnicodeString((UChar)0x5e)) {
2346 errln(UnicodeString("FAIL: (percent=^).getPositiveSuffix -> ") +
2357 errln(UnicodeString("FAIL: 0.25 x (permill=^) -> ") + s +
2361 if (fmt.getPositiveSuffix(s) != UnicodeString((UChar)0x5e)) {
2362 errln(UnicodeString("FAIL: (permill=^).getPositiveSuffix -> ") +
2372 if (fmt.format(12.5, s, pos) != UnicodeString("usd12.50")) {
2373 errln(UnicodeString("FAIL: 12.5 x (currency=usd) -> ") + s +
2377 if (fmt.getPositivePrefix(s) != UnicodeString("usd")) {
2378 errln(UnicodeString("FAIL: (currency=usd).getPositivePrefix -> ") +
2388 if (fmt.format(12.5, s, pos) != UnicodeString("DOL12.50")) {
2389 errln(UnicodeString("FAIL: 12.5 x (intlcurrency=DOL) -> ") + s +
2393 if (fmt.getPositivePrefix(s) != UnicodeString("DOL")) {
2394 errln(UnicodeString("FAIL: (intlcurrency=DOL).getPositivePrefix -> ") +
2432 UnicodeString pat;
2438 UnicodeString("Construct DecimalFormat(") + pat + ")")) {
2442 UnicodeString l, p;
2443 errln(UnicodeString("FAIL: ") + type[j] + avail[i].getDisplayName(l) +
2447 UnicodeString l, p;
2448 logln(UnicodeString("PASS: ") + type[j] + avail[i].getDisplayName(l) +
2458 UnicodeString("applyLocalizedPattern(") + pat + ")", avail[i]);
2469 UnicodeString("setCurrency() for (") + pat + ")", avail[i]);
2475 UnicodeString l, p;
2476 errln(UnicodeString("FAIL: ") + type[j] + avail[i].getDisplayName(l) +
2503 UnicodeString str((UnicodeString)"" + DATA[i]);
2511 errln(UnicodeString("FAIL: Wanted number, got ") +
2517 errln(UnicodeString("\"") + str + "\" parse(x " +
2544 UnicodeString s;
2546 if (s != UnicodeString(S[i])) {
2547 errln(UnicodeString("FAIL: Got ") + s + ", exp " + S[i]);
2566 UnicodeString s;
2568 UnicodeString pat;
2569 logln(UnicodeString() + a + " x " +
2571 if (s != UnicodeString("-0.1")) {
2585 DecimalFormat fmt(UnicodeString("0."), sym, status);
2593 UnicodeString str;
2594 UnicodeString exp(STR[i]);
2598 logln(UnicodeString("Ok ") + NUM[i] + " x 0. = " + str);
2600 errln(UnicodeString("FAIL ") + NUM[i] + " x 0. = " + str +
2616 DecimalFormat fmt(UnicodeString("#.#"), sym, status);
2621 UnicodeString str;
2625 UnicodeString exp("0");
2627 logln(UnicodeString("Ok 0.0 x #.# = ") + str);
2629 errln(UnicodeString("FAIL 0.0 x #.# = ") + str +
2639 logln(UnicodeString("Ok 99.99 / #.# = ") + toString(val));
2641 errln(UnicodeString("FAIL 99.99 / #.# = ") + toString(val) +
2648 logln(UnicodeString("Ok 0.0 x #.# = ") + str);
2650 errln(UnicodeString("FAIL 0.0 x #.# = ") + str +
2665 UnicodeString udt("11.10.2000", "");
2666 UnicodeString exp("11.10.00", "");
2671 … dataerrln("FAIL: Calendar::createInstance() returned " + (UnicodeString)u_errorName(status));
2678 … dataerrln("FAIL: NumberFormat::createInstance() returned " + (UnicodeString)u_errorName(status));
2688 errln("FAIL: DateFormat::createInstance() returned " + (UnicodeString)u_errorName(status));
2700 UnicodeString outString;
2751 UnicodeString numStr = "1000000000.6"; // 9 zeroes
2870 UnicodeString text("123");
2876 errln(UnicodeString("Parse failure at ") + pos.getErrorIndex());
2878 errln(UnicodeString("Incorrect parse result: ") + val.getLong() + " expected: " + expected);
2880 errln(UnicodeString("Incorrect parse position: ") + pos.getIndex() + " expected: " + expos);
2902 UnicodeString toParse("1,234","");
2906 … errln(UnicodeString("FAIL: parse(\"") + toParse + UnicodeString("\") returns ") + toString(n));
2914 UnicodeString toParse("1,234","");
2918 … errln(UnicodeString("FAIL: parse(\"") + toParse + UnicodeString("\") returns ") + toString(n));
3032 UnicodeString s;
3044 UnicodeString expected(num, -1, US_INV);