Lines Matching refs:status

37                     UErrorCode& status) const  in format()
39 return NumberFormat::format(number, toAppendTo, posIter, status); in format()
46 UErrorCode& status) const in format()
48 return NumberFormat::format(obj, toAppendTo, pos, status); in format()
75 UErrorCode& status) const in parse()
77 NumberFormat::parse(text, result, status); in parse()
186 NumberFormatRegressionTest::failure(UErrorCode status, const UnicodeString& msg, const Locale& l, U… in failure() argument
188 if(U_FAILURE(status)) { in failure()
191 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l.… in failure()
193 errcheckln(status, UnicodeString("FAIL: ", "") + msg in failure()
194 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l.… in failure()
203 NumberFormatRegressionTest::failure(UErrorCode status, const UnicodeString& msg, const char *l, UBo… in failure() argument
205 if(U_FAILURE(status)) { in failure()
208 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l,… in failure()
210 errcheckln(status, UnicodeString("FAIL: ", "") + msg in failure()
211 …+ UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "") + UnicodeString(l,… in failure()
220 NumberFormatRegressionTest::failure(UErrorCode status, const UnicodeString& msg, UBool possibleData… in failure() argument
222 if(U_FAILURE(status)) { in failure()
225 + UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "")); in failure()
227 errcheckln(status, UnicodeString("FAIL: ", "") + msg in failure()
228 + UnicodeString(" failed, error ", "") + UnicodeString(u_errorName(status), "")); in failure()
290 UErrorCode status = U_ZERO_ERROR; in Test4088161() local
291 DecimalFormat *df = new DecimalFormat(status); in Test4088161()
292 if (!failure(status, "new DecimalFormat", "")) { in Test4088161()
320 UErrorCode status = U_ZERO_ERROR; in Test4087245() local
321 DecimalFormatSymbols *symbols = new DecimalFormatSymbols(status); in Test4087245()
322 failure(status, "new DecimalFormatSymbols", ""); in Test4087245()
327 DecimalFormat *df = new DecimalFormat("#,##0.0", *symbols, status); in Test4087245()
328 failure(status, "new DecimalFormat with symbols", ""); in Test4087245()
350 UErrorCode status = U_ZERO_ERROR; in Test4087535() local
351 DecimalFormat *df = new DecimalFormat(status); in Test4087535()
352 if (U_FAILURE(status)) { in Test4087535()
353 dataerrln("Error creating DecimalFormat - %s", u_errorName(status)); in Test4087535()
378 UErrorCode status = U_ZERO_ERROR; in Test4088503() local
379 DecimalFormat *df = new DecimalFormat(status); in Test4088503()
380 if (U_FAILURE(status)) { in Test4088503()
381 dataerrln("Error creating DecimalFormat - %s", u_errorName(status)); in Test4088503()
412 UErrorCode status = U_ZERO_ERROR; in assignFloatValue() local
413 NumberFormat *nfcommon = NumberFormat::createCurrencyInstance(Locale::getUS(), status); in assignFloatValue()
414 if (failure(status, "NumberFormat::createCurrencyInstance", Locale::getUS(), TRUE)){ in assignFloatValue()
424 nfcommon->parse(stringValue, result, status); in assignFloatValue()
425 failure(status, "nfcommon->parse", Locale::getUS()); in assignFloatValue()
442 UErrorCode status = U_ZERO_ERROR; in Test4059870() local
443 DecimalFormat *format = new DecimalFormat("00", status); in Test4059870()
444 failure(status, "new Decimalformat", Locale::getUS()); in Test4059870()
448 format->parse(UnicodeString("0"), result, status); in Test4059870()
449 failure(status, "format->parse", Locale::getUS()); in Test4059870()
465 UErrorCode status = U_ZERO_ERROR; in Test4083018() local
466 DecimalFormatSymbols *dfs = new DecimalFormatSymbols(status); in Test4083018()
467 failure(status, "new DecimalFormatSymbols", Locale::getUS()); in Test4083018()
486 UErrorCode status = U_ZERO_ERROR; in Test4071492() local
487 NumberFormat *nf = NumberFormat::createInstance(status); in Test4071492()
488 if (failure(status, "NumberFormat::createInstance", Locale::getUS(), TRUE)) { in Test4071492()
510 UErrorCode status = U_ZERO_ERROR; in Test4086575() local
511 NumberFormat *nf1 = NumberFormat::createInstance(Locale::getFrance(), status); in Test4086575()
515 if(U_FAILURE(status)) { in Test4086575()
516 … is wrong with French number format - it should not fallback. Exitting - %s", u_errorName(status)); in Test4086575()
520 failure(status, "NumberFormat::createInstance", Locale::getFrance()); in Test4086575()
535 nf->applyLocalizedPattern(UnicodeString("###,00;(###,00)"), status); in Test4086575()
536 failure(status, "nf->applyLocalizedPattern", Locale::getFrance()); in Test4086575()
554 nf->applyLocalizedPattern(pat, status); in Test4086575()
555 failure(status, "nf->applyLocalizedPattern", Locale::getFrance()); in Test4086575()
592 UErrorCode status = U_ZERO_ERROR; in Test4068693() local
593 DecimalFormat *df = new DecimalFormat(status); in Test4068693()
594 if(U_FAILURE(status)) { in Test4068693()
595 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4068693()
599 failure(status, "new DecimalFormat"); in Test4068693()
648 UErrorCode status = U_ZERO_ERROR; in Test4087251() local
649 DecimalFormat *df = new DecimalFormat(status); in Test4087251()
650 if(U_FAILURE(status)) { in Test4087251()
651 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4087251()
655 failure(status, "new DecimalFormat"); in Test4087251()
657 df->applyPattern(UnicodeString("#.#.#"), status); in Test4087251()
658 if( ! U_FAILURE(status)) in Test4087251()
668 df->applyPattern("#0.0#0#0", status); in Test4087251()
669 if( ! U_FAILURE(status)) in Test4087251()
714 UErrorCode status = U_ZERO_ERROR; in Test4090504() local
715 DecimalFormat *df = new DecimalFormat(status); in Test4090504()
716 if(U_FAILURE(status)) { in Test4090504()
717 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4090504()
721 failure(status, "new DecimalFormat"); in Test4090504()
743 UErrorCode status = U_ZERO_ERROR; in Test4095713() local
744 DecimalFormat *df = new DecimalFormat(status); in Test4095713()
745 if(U_FAILURE(status)) { in Test4095713()
746 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4095713()
750 failure(status, "new DecimalFormat"); in Test4095713()
770 UErrorCode status = U_ZERO_ERROR; in Test4092561() local
771 DecimalFormat *df = new DecimalFormat(status); in Test4092561()
772 if(U_FAILURE(status)) { in Test4092561()
773 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4092561()
777 failure(status, "new DecimalFormat"); in Test4092561()
796 UErrorCode status = U_ZERO_ERROR; in Test4092480() local
797 DecimalFormat *dfFoo = new DecimalFormat(UnicodeString("000"), status); in Test4092480()
798 if(U_FAILURE(status)) { in Test4092480()
799 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4092480()
803 failure(status, "new DecimalFormat"); in Test4092480()
806 dfFoo->applyPattern("0000;-000", status); in Test4092480()
807 failure(status, "dfFoo->applyPattern"); in Test4092480()
814 dfFoo->applyPattern("000;-000", status); in Test4092480()
815 failure(status, "dfFoo->applyPattern"); in Test4092480()
821 dfFoo->applyPattern("000;-0000", status); in Test4092480()
822 failure(status, "dfFoo->applyPattern"); in Test4092480()
828 dfFoo->applyPattern("0000;-000", status); in Test4092480()
829 failure(status, "dfFoo->applyPattern"); in Test4092480()
849 UErrorCode status = U_ZERO_ERROR; in Test4087244() local
851 uloc_canonicalize("pt_PT_PREEURO", loc, 256, &status); in Test4087244()
853 NumberFormat *nf = NumberFormat::createCurrencyInstance(*de, status); in Test4087244()
854 if(U_FAILURE(status)) { in Test4087244()
855 dataerrln("Error creating DecimalFormat: %s", u_errorName(status)); in Test4087244()
917 UErrorCode status = U_ZERO_ERROR; in Test4070798() local
919 int len = uloc_canonicalize("fr_FR_PREEURO", loc, 256, &status); in Test4070798()
921 formatter = NumberFormat::createInstance(Locale(loc), status); in Test4070798()
922 if(U_FAILURE(status)) { in Test4070798()
923 dataerrln("Error creating DecimalFormat: %s", u_errorName(status)); in Test4070798()
927 failure(status, "NumberFormat::createInstance", loc); in Test4070798()
938 len = uloc_canonicalize("fr_FR_PREEURO", loc, 256, &status); in Test4070798()
939 formatter = NumberFormat::createCurrencyInstance(loc, status); in Test4070798()
940 failure(status, "NumberFormat::createCurrencyInstance", loc); in Test4070798()
953 uloc_canonicalize("fr_FR_PREEURO", loc, 256, &status); in Test4070798()
954 formatter = NumberFormat::createPercentInstance(Locale(loc), status); in Test4070798()
955 failure(status, "NumberFormat::createPercentInstance", loc); in Test4070798()
994 UErrorCode status = U_ZERO_ERROR; in Test4071005() local
995 formatter = NumberFormat::createInstance(Locale::getCanadaFrench(), status); in Test4071005()
996 if (failure(status, "NumberFormat::createInstance", Locale::getCanadaFrench(), TRUE)){ in Test4071005()
1011 formatter = NumberFormat::createCurrencyInstance(Locale::getCanadaFrench(), status); in Test4071005()
1012 failure(status, "NumberFormat::createCurrencyInstance", Locale::getCanadaFrench()); in Test4071005()
1025 formatter = NumberFormat::createPercentInstance(Locale::getCanadaFrench(), status); in Test4071005()
1026 failure(status, "NumberFormat::createPercentInstance", Locale::getCanadaFrench()); in Test4071005()
1060 UErrorCode status = U_ZERO_ERROR; in Test4071014() local
1062 uloc_canonicalize("de_DE_PREEURO", loc, 256, &status); in Test4071014()
1063 formatter = NumberFormat::createInstance(Locale(loc), status); in Test4071014()
1064 if (failure(status, "NumberFormat::createInstance", loc, TRUE)){ in Test4071014()
1079 uloc_canonicalize("de_DE_PREEURO", loc, 256, &status); in Test4071014()
1080 formatter = NumberFormat::createCurrencyInstance(Locale(loc), status); in Test4071014()
1081 failure(status, "NumberFormat::createCurrencyInstance", loc); in Test4071014()
1094 formatter = NumberFormat::createPercentInstance(Locale::getGermany(), status); in Test4071014()
1095 failure(status, "NumberFormat::createPercentInstance", Locale::getGermany()); in Test4071014()
1126 UErrorCode status = U_ZERO_ERROR; in Test4071859() local
1128 uloc_canonicalize("it_IT_PREEURO", loc, 256, &status); in Test4071859()
1129 formatter = NumberFormat::createInstance(Locale(loc), status); in Test4071859()
1130 if (failure(status, "NumberFormat::createNumberInstance", TRUE)){ in Test4071859()
1144 uloc_canonicalize("it_IT_PREEURO", loc, 256, &status); in Test4071859()
1145 formatter = NumberFormat::createCurrencyInstance(Locale(loc), status); in Test4071859()
1146 failure(status, "NumberFormat::createCurrencyInstance"); in Test4071859()
1158 uloc_canonicalize("it_IT_PREEURO", loc, 256, &status); in Test4071859()
1159 formatter = NumberFormat::createPercentInstance(Locale(loc), status); in Test4071859()
1160 failure(status, "NumberFormat::createPercentInstance"); in Test4071859()
1179 UErrorCode status = U_ZERO_ERROR; in Test4093610() local
1180 DecimalFormat *df = new DecimalFormat("#0.#", status); in Test4093610()
1181 if (!failure(status, "new DecimalFormat")) { in Test4093610()
1221 UErrorCode status = U_ZERO_ERROR; in Test4098741() local
1222 NumberFormat *fmt = NumberFormat::createPercentInstance(status); in Test4098741()
1223 if (U_FAILURE(status)) { in Test4098741()
1245 UErrorCode status = U_ZERO_ERROR; in Test4074454() local
1246 DecimalFormat *fmt = new DecimalFormat("#,#00.00;-#.#", status); in Test4074454()
1247 if(U_FAILURE(status)) { in Test4074454()
1248 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4074454()
1252 failure(status, "new DecimalFormat"); in Test4074454()
1254 DecimalFormat *newFmt = new DecimalFormat("#,#00.00 p''ieces;-#,#00.00 p''ieces", status); in Test4074454()
1255 failure(status, "new DecimalFormat"); in Test4074454()
1290 UErrorCode status = U_ZERO_ERROR; in Test4099404() local
1291 DecimalFormat *fmt = new DecimalFormat(UnicodeString("000.0#0"), status); in Test4099404()
1292 if(! U_FAILURE(status)) in Test4099404()
1300 fmt = new DecimalFormat(UnicodeString("0#0.000"), status); in Test4099404()
1301 if( !U_FAILURE(status)) in Test4099404()
1314 UErrorCode status = U_ZERO_ERROR; in Test4101481() local
1315 DecimalFormat *sdf = new DecimalFormat(UnicodeString("#,##0"), status); in Test4101481()
1316 if(U_FAILURE(status)) { in Test4101481()
1317 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4101481()
1321 failure(status, "new DecimalFormat"); in Test4101481()
1332 UErrorCode status = U_ZERO_ERROR; in Test4052223() local
1333 DecimalFormat *fmt = new DecimalFormat(UnicodeString("#,#00.00"), status); in Test4052223()
1334 if(U_FAILURE(status)) { in Test4052223()
1335 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4052223()
1339 failure(status, "new DecimalFormat"); in Test4052223()
1341 fmt->parse(UnicodeString("abc3"), num, status); in Test4052223()
1342 if(! U_FAILURE(status)) in Test4052223()
1354 UErrorCode status = U_ZERO_ERROR; in Test4061302() local
1355 DecimalFormatSymbols *fmt = new DecimalFormatSymbols(status); in Test4061302()
1356 if (U_FAILURE(status)) { in Test4061302()
1357 dataerrln("Error creating DecimalFormatSymbols - %s", u_errorName(status)); in Test4061302()
1395 UErrorCode status = U_ZERO_ERROR; in Test4062486() local
1396 DecimalFormat *fmt = new DecimalFormat(UnicodeString("#,##0.00"), status); in Test4062486()
1397 if (U_FAILURE(status)) { in Test4062486()
1398 dataerrln("Error creating DecimalFormat - %s", u_errorName(status)); in Test4062486()
1420 UErrorCode status = U_ZERO_ERROR; in Test4108738() local
1421 DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getUS(), status); in Test4108738()
1422 failure(status, "new DecimalFormatSymbols"); in Test4108738()
1423 DecimalFormat *df = new DecimalFormat("#,##0.###", syms, status); in Test4108738()
1424 if(U_FAILURE(status)) { in Test4108738()
1425 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4108738()
1429 failure(status, "new DecimalFormat"); in Test4108738()
1461 UErrorCode status = U_ZERO_ERROR; in Test4106658() local
1462 DecimalFormat *df = new DecimalFormat(status); // Corrected; see 4147706 in Test4106658()
1463 if(U_FAILURE(status)) { in Test4106658()
1464 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4106658()
1468 failure(status, "new DecimalFormat"); in Test4106658()
1497 UErrorCode status = U_ZERO_ERROR; in Test4106662() local
1498 DecimalFormat *df = new DecimalFormat(status); in Test4106662()
1499 if(U_FAILURE(status)) { in Test4106662()
1500 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4106662()
1504 failure(status, "new DecimalFormat"); in Test4106662()
1516 df = new DecimalFormat(UnicodeString("$###.00"), status); in Test4106662()
1517 failure(status, "new DecimalFormat"); in Test4106662()
1531 UErrorCode status = U_ZERO_ERROR; in Test4114639() local
1532 NumberFormat *format = NumberFormat::createInstance(status); in Test4114639()
1533 if(U_FAILURE(status)) { in Test4114639()
1534 dataerrln("Error creating DecimalFormat: %s", u_errorName(status)); in Test4114639()
1538 failure(status, "NumberFormat::createInstance"); in Test4114639()
1556 UErrorCode status = U_ZERO_ERROR; in Test4106664() local
1557 DecimalFormat *df = new DecimalFormat(status); in Test4106664()
1558 if(U_FAILURE(status)) { in Test4106664()
1559 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4106664()
1563 failure(status, "new DecimalFormat"); in Test4106664()
1590 UErrorCode status = U_ZERO_ERROR; in Test4106667() local
1591 DecimalFormat *df = new DecimalFormat(status); in Test4106667()
1592 if(U_FAILURE(status)) { in Test4106667()
1593 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4106667()
1597 failure(status, "new DecimalFormat"); in Test4106667()
1630 UErrorCode status = U_ZERO_ERROR; in Test4110936() local
1631 NumberFormat *nf = NumberFormat::createInstance(status); in Test4110936()
1632 if(U_FAILURE(status)) { in Test4110936()
1633 dataerrln("Error creating DecimalFormat: %s", u_errorName(status)); in Test4110936()
1637 failure(status, "NumberFormat::createInstance"); in Test4110936()
1660 UErrorCode status = U_ZERO_ERROR; in Test4122840() local
1663 locales[i], status); in Test4122840()
1664 failure(status, "new ResourceBundle"); in Test4122840()
1665 ResourceBundle numPat = rb->getWithFallback("NumberElements", status); in Test4122840()
1666 failure(status, "rb.get(NumberElements)"); in Test4122840()
1667 numPat = numPat.getWithFallback("latn",status); in Test4122840()
1668 failure(status, "rb.get(latn)"); in Test4122840()
1669 numPat = numPat.getWithFallback("patterns",status); in Test4122840()
1670 failure(status, "rb.get(patterns)"); in Test4122840()
1671 numPat = numPat.getWithFallback("currencyFormat",status); in Test4122840()
1672 failure(status, "rb.get(currencyFormat)"); in Test4122840()
1678 UnicodeString pattern = numPat.getString(status); in Test4122840()
1679 failure(status, "rb->getString()"); in Test4122840()
1692 DecimalFormatSymbols *symbols = new DecimalFormatSymbols(locales[i], status); in Test4122840()
1693 failure(status, "new DecimalFormatSymbols"); in Test4122840()
1694 DecimalFormat *fmt1 = new DecimalFormat(pattern, *symbols, status); in Test4122840()
1695 failure(status, "new DecimalFormat"); in Test4122840()
1730 DecimalFormat *fmt2 = new DecimalFormat(buf, *symbols, status); in Test4122840()
1731 failure(status, "new DecimalFormat"); in Test4122840()
1736 double rounding = ucurr_getRoundingIncrement(currency, &status); in Test4122840()
1737 int32_t frac = ucurr_getDefaultFractionDigits(currency, &status); in Test4122840()
1738 if (U_SUCCESS(status)) { in Test4122840()
1744 failure(status, "Fetching currency rounding/fractions"); in Test4122840()
1770 UErrorCode status = U_ZERO_ERROR; in Test4125885() local
1772 DecimalFormat *formatDec = new DecimalFormat ("000.00", status); in Test4125885()
1773 if(U_FAILURE(status)) { in Test4125885()
1774 errcheckln(status, "Error creating DecimalFormat: %s", u_errorName(status)); in Test4125885()
1778 failure(status, "new DecimalFormat"); in Test4125885()
1788 formatDec = new DecimalFormat ("+000.00%;-000.00%", status); in Test4125885()
1789 failure(status, "new DecimalFormat"); in Test4125885()
1805 UErrorCode status = U_ZERO_ERROR; in Test4134034() local
1806 DecimalFormat *nf = new DecimalFormat("##,###,###.00", status); in Test4134034()
1807 if (!failure(status, "new DecimalFormat")) { in Test4134034()
1864 UErrorCode status = U_ZERO_ERROR; in Test4134300() local
1865 DecimalFormat *df = new DecimalFormat(DATA[i], status); in Test4134300()
1866 if (!failure(status, "new DecimalFormat")) { in Test4134300()
1888 UErrorCode status = U_ZERO_ERROR; in Test4140009() local
1889 DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getEnglish(), status); in Test4140009()
1890 failure(status, "new DecimalFormatSymbols"); in Test4140009()
1891 DecimalFormat *f = new DecimalFormat(UnicodeString(""), syms, status); in Test4140009()
1892 if (!failure(status, "new DecimalFormat")) { in Test4140009()
1931 UErrorCode status = U_ZERO_ERROR; in Test4145457() local
1932 NumberFormat *nff = NumberFormat::createInstance(status); in Test4145457()
1933 if (failure(status, "NumberFormat::createInstance", TRUE)){ in Test4145457()
1953 nf->applyPattern(PATS[i], status); in Test4145457()
1954 failure(status, "nf->applyPattern"); in Test4145457()
1965 nf->applyPattern(pat, status); in Test4145457()
1966 failure(status, "nf->applyPattern"); in Test4145457()
2009 UErrorCode status = U_ZERO_ERROR; in Test4147295() local
2010 DecimalFormat *sdf = new DecimalFormat(status); in Test4147295()
2013 sdf->applyPattern(pattern, status); in Test4147295()
2014 if (!failure(status, "sdf->applyPattern")) { in Test4147295()
2036 UErrorCode status = U_ZERO_ERROR; in Test4147706() local
2037 DecimalFormat *df = new DecimalFormat("#,##0.0##", status); in Test4147706()
2038 failure(status, "new DecimalFormat"); in Test4147706()
2039 DecimalFormatSymbols *syms = new DecimalFormatSymbols(Locale::getEnglish(), status); in Test4147706()
2040 if (!failure(status, "new DecimalFormatSymbols")) { in Test4147706()
2091 UErrorCode status = U_ZERO_ERROR; in Test4162198() local
2092 NumberFormat *f = NumberFormat::createInstance(status); in Test4162198()
2093 if(U_FAILURE(status)) { in Test4162198()
2094 dataerrln("Couldn't create number format - %s", u_errorName(status)); in Test4162198()
2104 f->parse(s, n, status); in Test4162198()
2105 if(U_FAILURE(status)) in Test4162198()
2133 UErrorCode status = U_ZERO_ERROR; local
2135 NumberFormat *f = (i == 0) ? NumberFormat::createInstance(status)
2136 : NumberFormat::createPercentInstance(status);
2137 if(U_FAILURE(status)) {
2138 dataerrln("Couldn't create number format - %s", u_errorName(status));
2146 f->parse(s, n, status);
2147 if(U_FAILURE(status))
2172 UErrorCode status = U_ZERO_ERROR; local
2173 NumberFormat *fmt = NumberFormat::createInstance(Locale::getUS(), status);
2174 if (failure(status, "NumberFormat::createInstance", TRUE)){
2183 fmt->parse(s, num, status);
2184 failure(status, "Parse");
2208 UErrorCode status = U_ZERO_ERROR; local
2209 NumberFormat *nf = NumberFormat::createInstance(Locale::getUS(), status);
2210 if (failure(status, "NumberFormat::createInstance", TRUE)){
2247 UErrorCode status = U_ZERO_ERROR; local
2250 DecimalFormat df(DATA[i], status);
2251 if (!failure(status, "DecimalFormat constructor")) {
2280 UErrorCode status = U_ZERO_ERROR; local
2281 DecimalFormatSymbols sym(Locale::getUS(), status);
2282 failure(status, "Construct DecimalFormatSymbols");
2283 DecimalFormat fmt("#", sym, status);
2284 if (!failure(status, "Construct DecimalFormat")) {
2289 fmt.applyPattern(pat, status);
2290 failure(status, "applyPattern");
2312 UErrorCode status = U_ZERO_ERROR; local
2313 DecimalFormatSymbols sym(Locale::getUS(), status);
2315 failure(status, "DecimalFormatSymbols ct", Locale::getUS());
2316 DecimalFormat fmt(UnicodeString("#"), sym, status);
2317 if(failure(status, "DecimalFormat ct", Locale::getUS())) {
2338 fmt.applyPattern(UnicodeString("#%"), status);
2339 failure(status, "applyPattern percent");
2354 fmt.applyPattern(str("#\\u2030"), status);
2355 failure(status, "applyPattern permill");
2370 fmt.applyPattern(str("\\u00A4#.00"), status);
2371 failure(status, "applyPattern currency");
2386 fmt.applyPattern(str("\\u00A4\\u00A4#.00"), status);
2387 failure(status, "applyPattern intl currency");
2413 status = U_ZERO_ERROR;
2417 nf = NumberFormat::createInstance(avail[i], status);
2418 failure(status, "createInstance", avail[i]);
2421 nf = NumberFormat::createCurrencyInstance(avail[i], status);
2422 failure(status, "createCurrencyInstance", avail[i]);
2425 nf = NumberFormat::createPercentInstance(avail[i], status);
2426 failure(status, "createPercentInstance", avail[i]);
2429 if (U_FAILURE(status)) {
2437 DecimalFormatSymbols symb(avail[i], status);
2438 failure(status, "Construct DecimalFormatSymbols", avail[i]);
2439 DecimalFormat f2(pat, symb, status);
2440 if (failure(status,
2460 failure(status,
2462 if (U_FAILURE(status)) {
2471 failure(status,
2473 if (U_FAILURE(status)) {
2497 UErrorCode status = U_ZERO_ERROR; local
2498 DecimalFormat *fmt = (DecimalFormat*) NumberFormat::createInstance(Locale::getUS(), status);
2499 if (failure(status, "createInstance", Locale::getUS(), TRUE)){
2510 fmt->parse(str, num, status);
2511 failure(status, "parse", Locale::getUS());
2539 UErrorCode status = U_ZERO_ERROR; local
2540 NumberFormat *fmt = NumberFormat::createInstance(Locale::getUS(), status);
2541 if (failure(status, "createInstance", Locale::getUS(), TRUE)){
2560 UErrorCode status = U_ZERO_ERROR; local
2561 NumberFormat *nf = NumberFormat::createInstance(Locale::getUS(), status);
2562 if (failure(status, "createInstance", Locale::getUS(), TRUE)){
2585 UErrorCode status = U_ZERO_ERROR; local
2586 DecimalFormatSymbols sym(Locale::getUS(), status);
2587 failure(status, "DecimalFormatSymbols ct", Locale::getUS());
2588 DecimalFormat fmt(UnicodeString("0."), sym, status);
2590 if (!failure(status, "DecimalFormat ct", Locale::getUS())) {
2616 UErrorCode status = U_ZERO_ERROR; local
2617 DecimalFormatSymbols sym(Locale::getUS(), status);
2618 failure(status, "DecimalFormatSymbols ct", Locale::getUS());
2619 DecimalFormat fmt(UnicodeString("#.#"), sym, status);
2620 if (failure(status, "DecimalFormat ct", Locale::getUS())) {
2638 fmt.parse(str, val, status);
2639 failure(status, "DecimalFormat.parse(99.99)", Locale::getUS());
2664 UErrorCode status = U_ZERO_ERROR; local
2672 Calendar *cal = Calendar::createInstance(loc, status);
2673 if (U_FAILURE(status)) {
2674 … dataerrln("FAIL: Calendar::createInstance() returned " + (UnicodeString)u_errorName(status));
2679 NumberFormat *nf = NumberFormat::createInstance(loc, status);
2680 if (U_FAILURE(status)) {
2681 … dataerrln("FAIL: NumberFormat::createInstance() returned " + (UnicodeString)u_errorName(status));
2690 if (U_FAILURE(status)) {
2691 errln("FAIL: DateFormat::createInstance() returned " + (UnicodeString)u_errorName(status));
2700 UDate ulocdat = df->parse(udt, status);
2718 #define TEST_CHECK_STATUS(status) { \ argument
2719 if (U_FAILURE(status)) { \
2720 if (status == U_MISSING_RESOURCE_ERROR) { \
2721 dataerrln("File %s, Line %d: status=%s", __FILE__, __LINE__, u_errorName(status)); \
2723 errln("File %s, Line %d: status=%s", __FILE__, __LINE__, u_errorName(status)); \
2744 UErrorCode status = U_ZERO_ERROR; local
2745 NumberFormat *nf = NumberFormat::createInstance(Locale::getEnglish(), status);
2750 TEST_CHECK_STATUS(status);
2757 nf->parse(numStr, val, status);
2758 TEST_CHECK_STATUS(status);
2760 TEST_ASSERT(1000000000 == val.getInt64(status));
2761 TEST_CHECK_STATUS(status);
2762 TEST_ASSERT(1000000000.6 == val.getDouble(status));
2763 TEST_CHECK_STATUS(status);
2768 nf->parse(numStr, val, status);
2769 TEST_CHECK_STATUS(status);
2771 TEST_ASSERT(100000000000000001LL == val.getInt64(status));
2772 TEST_CHECK_STATUS(status);
2773 TEST_ASSERT(100000000000000000.0 == val.getDouble(status));
2774 TEST_CHECK_STATUS(status);
2777 nf->parse(numStr, val, status);
2778 TEST_CHECK_STATUS(status);
2781 TEST_ASSERT(1.0E17 == val.getDouble(status));
2782 TEST_CHECK_STATUS(status);
2785 nf->parse(numStr, val, status);
2786 TEST_CHECK_STATUS(status);
2792 TEST_ASSERT(9223372036854775808.0 >= val.getDouble(status));
2793 TEST_ASSERT(9223372036854774700.0 <= val.getDouble(status));
2794 TEST_CHECK_STATUS(status);
2797 nf->parse(numStr, val, status);
2798 TEST_CHECK_STATUS(status);
2802 TEST_ASSERT(-9223372036854775808.0 == val.getDouble(status));
2803 TEST_CHECK_STATUS(status);
2806 nf->parse(numStr, val, status);
2807 TEST_CHECK_STATUS(status);
2809 TEST_ASSERT(9223372036854775807LL == val.getInt64(status));
2810 TEST_ASSERT(status == U_INVALID_FORMAT_ERROR);
2811 status = U_ZERO_ERROR;
2812 TEST_ASSERT(9223372036854775810.0 == val.getDouble(status));
2813 TEST_CHECK_STATUS(status);
2816 nf->parse(numStr, val, status);
2817 TEST_CHECK_STATUS(status);
2820 TEST_ASSERT((int64_t)0x8000000000000000LL == val.getInt64(status));
2821 TEST_ASSERT(status == U_INVALID_FORMAT_ERROR);
2822 status = U_ZERO_ERROR;
2823 TEST_ASSERT(-9223372036854775810.0 == val.getDouble(status));
2824 TEST_CHECK_STATUS(status);
2832 status = U_ZERO_ERROR;
2834 nf->parse(numStr, val, status);
2835 TEST_CHECK_STATUS(status);
2838 TEST_ASSERT(9007199254740991LL == val.getInt64(status));
2839 TEST_ASSERT(9007199254740991.0 == val.getDouble(status));
2840 TEST_CHECK_STATUS(status);
2842 status = U_ZERO_ERROR;
2844 nf->parse(numStr, val, status);
2845 TEST_CHECK_STATUS(status);
2847 TEST_ASSERT(9007199254740992LL == val.getInt64(status));
2848 TEST_ASSERT(9007199254740992.0 == val.getDouble(status));
2849 TEST_CHECK_STATUS(status);
2851 status = U_ZERO_ERROR;
2853 nf->parse(numStr, val, status); // the ones digit, putting it up to ...994
2854 TEST_CHECK_STATUS(status);
2856 TEST_ASSERT_EQUALS((int64_t)9007199254740993LL,val.getInt64(status));
2857 TEST_ASSERT_EQUALS((double)9007199254740994.0,(double)val.getDouble(status));
2858 TEST_CHECK_STATUS(status);
2864 UErrorCode status = U_ZERO_ERROR; local
2867 DecimalFormat fmt("+##", status);
2868 if (U_FAILURE(status)) {
2869 dataerrln("Failed to create DecimalFormat with pattern '+##' - %s", u_errorName(status));
2890 UErrorCode status = U_ZERO_ERROR; local
2891 NumberFormat *nf = NumberFormat::createInstance(Locale::getUS(), status);
2892 if (failure(status, "NumberFormat::createInstance", TRUE)){
2936 UErrorCode status = U_ZERO_ERROR; local
2937 LocalUNumberFormatPointer f(unum_open(UNUM_DEFAULT, NULL, 0, "en_US", NULL, &status));
2938 if (U_FAILURE(status)) {
2943 if (U_SUCCESS(status)) {
2944 unum_applyPattern(f.getAlias(), FALSE, pattern, -1, NULL, &status);
2945 unum_setTextAttribute(f.getAlias(), UNUM_POSITIVE_PREFIX, positivePrefix, -1, &status);
2946 assertSuccess("setting attributes", status);
2949 if(U_SUCCESS(status)) {
2950 int32_t n = unum_parse(f.getAlias(), text, -1, NULL, &status);
2951 logln("unum_parse status %s, result %d\n", u_errorName(status), n);
2953 if(U_FAILURE(status)) {
2954 logln("Got expected parse error %s\n", u_errorName(status));
2955 status = U_ZERO_ERROR;
2957 errln("FAIL: unum_parse status %s, result %d - expected failure\n", u_errorName(status), n);
2961 if (U_SUCCESS(status)) {
2962 unum_setTextAttribute(f.getAlias(), UNUM_POSITIVE_PREFIX, NULL, 0, &status);
2963 assertSuccess("setting attributes", status);
2967 if(U_SUCCESS(status)) {
2968 int32_t n = unum_parse(f.getAlias(), text, -1, NULL, &status);
2969 logln("unum_parse status %s, result %d\n", u_errorName(status), n);
2971 if(U_FAILURE(status)) {
2972 errln("FAIL: with pos prefix removed, parse error %s\n", u_errorName(status));
2973 status = U_ZERO_ERROR;
2976 …os prefix removed , unum_parse status %s, result %d expected 123456789\n", u_errorName(status), n);
2978 …pos prefix removed , unum_parse status %s, result %d expected 123456789\n", u_errorName(status),n);
2983 if(U_SUCCESS(status)) {
2984 int32_t n = unum_parse(f.getAlias(), text2, -1, NULL, &status);
2985 logln("unum_parse status %s, result %d\n", u_errorName(status), n);
2987 if(U_FAILURE(status)) {
2988 logln("text2: Got expected parse error %s\n", u_errorName(status));
2989 status = U_ZERO_ERROR;
2991 …errln("FAIL: text2: unum_parse status %s, result %d - expected failure\n", u_errorName(status), n);
2995 if (U_SUCCESS(status)) {
2996 unum_setTextAttribute(f.getAlias(), UNUM_NEGATIVE_PREFIX, negativePrefix, -1, &status);
2997 assertSuccess("setting attributes", status);
3001 if(U_SUCCESS(status)) {
3002 int32_t n = unum_parse(f.getAlias(), text2, -1, NULL, &status);
3003 logln("unum_parse status %s, result %d\n", u_errorName(status), n);
3005 if(U_FAILURE(status)) {
3006 errln("FAIL: with different neg prefix , parse error %s\n", u_errorName(status));
3007 status = U_ZERO_ERROR;
3011 …erent neg prefix , unum_parse status %s, result %d expected -123456789\n", u_errorName(status), n);
3013 …erent neg prefix , unum_parse status %s, result %d expected -123456789\n", u_errorName(status), n);
3022 UErrorCode status = U_ZERO_ERROR; local
3023 DecimalFormatSymbols symbols(Locale::getEnglish(), status);
3024 LocalPointer<DecimalFormat> df(new DecimalFormat("###.##", symbols, status), status);
3025 TEST_CHECK_STATUS(status);
3038 fmtable.setDecimalNumber(num, status);
3039 TEST_CHECK_STATUS(status);
3042 df->format(fmtable, s, pos, status);
3043 TEST_CHECK_STATUS(status);