Lines Matching refs:ec

795     UErrorCode ec = U_ZERO_ERROR;
797 NumberFormat::createCurrencyInstance(Locale::getUS(), ec);
799 if (U_FAILURE(ec)) {
800 dataerrln("FAIL: getCurrencyInstance(US) - %s", u_errorName(ec));
822 fmt = NumberFormat::createCurrencyInstance(Locale::getFrance(), ec);
824 if (U_FAILURE(ec)) {
1210 UErrorCode ec = U_ZERO_ERROR;
1211 DecimalFormatSymbols US(Locale::getUS(), ec);
1212 DecimalFormat fmt("a b#0c ", US, ec);
1213 if (U_FAILURE(ec)) {
1214 errcheckln(ec, "FAIL: Constructor - %s", u_errorName(ec));
1227 // UErrorCode ec = U_ZERO_ERROR;
1229 // NumberFormat* fmt = NumberFormat::createCurrencyInstance(loc, ec);
1230 // if (U_SUCCESS(ec)) {
1706 UErrorCode ec = U_ZERO_ERROR;
1707 NumberFormat* nf = NumberFormat::createCurrencyInstance(locs[i], ec);
1708 if (U_FAILURE(ec)) {
1709 errln("FAIL: Can't create NumberFormat(%s) - %s", locs[i].getName(), u_errorName(ec));
1813 UErrorCode ec = U_ZERO_ERROR;
1827 &isChoiceFormat, &len, &ec)),
1833 &isChoiceFormat, &len, &ec)),
1839 &isChoiceFormat, &len, &ec)),
1845 &isChoiceFormat, &len, &ec)),
1851 &isChoiceFormat, &len, &ec)),
1857 &isChoiceFormat, &len, &ec)),
1863 &isChoiceFormat, &len, &ec)),
1865 assertSuccess("ucurr_getName", ec);
1867 ec = U_ZERO_ERROR;
1871 &len, &ec);
1873 U_USING_FALLBACK_WARNING == ec, TRUE, possibleDataError);
1876 &len, &ec);
1878 U_USING_FALLBACK_WARNING == ec, TRUE, possibleDataError);
1881 &len, &ec);
1883 U_USING_DEFAULT_WARNING == ec || U_USING_FALLBACK_WARNING == ec, TRUE);
1886 &len, &ec);
1888 U_USING_DEFAULT_WARNING == ec, TRUE);
1892 &len, &ec);
1894 U_USING_DEFAULT_WARNING == ec, TRUE);
1900 UErrorCode ec = U_ZERO_ERROR;
1904 CurrencyUnit cu(USD, ec);
1905 assertSuccess("CurrencyUnit", ec);
1919 CurrencyUnit bad(BAD, ec);
1920 assertSuccess("CurrencyUnit", ec);
1924 CurrencyUnit bad2(BAD2, ec);
1925 assertSuccess("CurrencyUnit", ec);
1940 UErrorCode ec = U_ZERO_ERROR;
1942 CurrencyAmount ca(9, USD, ec);
1943 assertSuccess("CurrencyAmount", ec);
2015 UErrorCode ec = U_ZERO_ERROR;
2016 DecimalFormatSymbols *sym = new DecimalFormatSymbols(Locale::getUS(), ec);
2017 if (U_FAILURE(ec)) {
2018 errcheckln(ec, "Fail: DecimalFormatSymbols constructor - %s", u_errorName(ec));
2024 DecimalFormat fmt(pat, sym, ec);
2025 if (U_FAILURE(ec)) {
2038 sym = new DecimalFormatSymbols(Locale::getUS(), ec);
2039 if (U_FAILURE(ec)) {
2055 sym = new DecimalFormatSymbols(Locale::getUS(), ec);
2056 if (U_FAILURE(ec)) {
2061 DecimalFormat fmt2(pat, sym, ec);
2062 if (U_FAILURE(ec)) {
2067 DecimalFormatSymbols sym2(Locale::getUS(), ec);
2068 if (U_FAILURE(ec)) {
2085 UErrorCode ec = U_ZERO_ERROR;
2087 DecimalFormat fmt(ctou("###.###\\u2030"), ec);
2088 if (!assertSuccess("DecimalFormat ct", ec)) return;
2092 DecimalFormatSymbols sym(Locale::getUS(), ec);
2094 DecimalFormat fmt2("", sym, ec);
2095 fmt2.applyLocalizedPattern("###.###m", ec);
2096 if (!assertSuccess("setup", ec)) return;
2119 UErrorCode ec = U_ZERO_ERROR;
2120 DecimalFormat fmt(pat, ec); // locale doesn't matter here
2121 if (U_SUCCESS(ec) == valid) {
2123 pat, u_errorName(ec));
2125 errcheckln(ec, "FAIL: pattern \"%s\" should have %s; got %s",
2127 u_errorName(ec));
2170 UErrorCode& ec) {
2176 fmt.parse(num, n, ec);
2177 result.adoptObject(new CurrencyAmount(n, cur.getTerminatedBuffer(), ec));
2181 UErrorCode ec = U_ZERO_ERROR;
2182 TextFile reader("NumberFormatTestCases.txt", "UTF8", ec);
2183 if (U_FAILURE(ec)) {
2196 ec = U_ZERO_ERROR;
2197 if (!tokens.next(tok, ec)) {
2205 if (!tokens.next(tok, ec)) goto error;
2208 new DecimalFormatSymbols(Locale::getUS(), ec), ec);
2209 if (U_FAILURE(ec)) {
2216 if (!tokens.next(tok, ec)) goto error;
2217 loc = Locale::createFromName(CharString().appendInvariantChars(tok, ec).data());
2223 if (!tokens.next(tok, ec)) goto error;
2227 fmt = new DecimalFormat(pat, new DecimalFormatSymbols(loc, ec), ec);
2228 if (U_FAILURE(ec)) {
2229 errln("FAIL: " + where + "Pattern \"" + pat + "\": " + u_errorName(ec));
2230 ec = U_ZERO_ERROR;
2231 if (!tokens.next(tok, ec)) goto error;
2232 if (!tokens.next(tok, ec)) goto error;
2234 if (!tokens.next(tok, ec)) goto error;
2244 if (!tokens.next(num, ec)) goto error;
2245 if (!tokens.next(str, ec)) goto error;
2246 ref->parse(num, n, ec);
2247 assertSuccess("parse", ec);
2249 str, fmt->format(n, out.remove(), ec));
2250 assertSuccess("format", ec);
2252 if (!tokens.next(num, ec)) goto error;
2253 ref->parse(num, n, ec);
2254 assertSuccess("parse", ec);
2258 fmt->parse(str, m, ec);
2259 assertSuccess("parse", ec);
2267 if (!tokens.next(str, ec)) goto error;
2268 if (!tokens.next(expstr, ec)) goto error;
2270 ref->parse(expstr, exp, ec);
2271 assertSuccess("parse", ec);
2272 fmt->parse(str, n, ec);
2273 assertSuccess("parse", ec);
2279 if (!tokens.next(tok, ec)) goto error;
2285 CharString().appendInvariantChars(mloc, ec).data()), ec);
2286 if (U_FAILURE(ec)) {
2287 errln("FAIL: " + where + "Loc \"" + mloc + "\": " + u_errorName(ec));
2288 ec = U_ZERO_ERROR;
2289 if (!tokens.next(tok, ec)) goto error;
2290 if (!tokens.next(tok, ec)) goto error;
2291 if (!tokens.next(tok, ec)) goto error;
2296 if (!tokens.next(currAmt, ec)) goto error;
2297 if (!tokens.next(str, ec)) goto error;
2298 parseCurrencyAmount(currAmt, *ref, (UChar)0x2F/*'/'*/, n, ec);
2299 if (assertSuccess("parseCurrencyAmount", ec)) {
2301 str, mfmt->format(n, out.remove(), ec));
2302 assertSuccess("format", ec);
2304 if (!tokens.next(currAmt, ec)) goto error;
2305 parseCurrencyAmount(currAmt, *ref, (UChar)0x2F/*'/'*/, n, ec);
2306 if (assertSuccess("parseCurrencyAmount", ec)) {
2309 mfmt->parseObject(str, m, ec);
2310 if (assertSuccess("parseCurrency", ec)) {
2326 if (!tokens.next(testpat, ec)) goto error;
2327 if (!tokens.next(exppat, ec)) goto error;
2374 if (U_SUCCESS(ec)) {
2377 errcheckln(ec, "FAIL: " + where + "Unexpected " + u_errorName(ec));
2566 UErrorCode ec = U_ZERO_ERROR;
2572 ucurr_forLocale(locale.getName(), curr, 4, &ec);
2573 assertSuccess("ucurr_forLocale", ec);
2574 fmt.setCurrency(curr, ec);
2575 assertSuccess("DecimalFormat::setCurrency", ec);
2585 NumberFormat::createInstance(Locale::getUS(), ec);
2587 if (U_FAILURE(ec)) {
3133 UErrorCode ec;
3137 ec = U_ZERO_ERROR;
3140 NumberFormat *origFmt = NumberFormat::createInstance(loc,ec);
3141 if (U_FAILURE(ec)) {
3142 dataerrln("FAIL: getInstance(%s) - %s", item->localeName, u_errorName(ec));
3160 ec = U_ZERO_ERROR;
3162 NumberFormat* fmt4= NumberFormat::createInstance(loc4, ec);
3163 if ( ec != U_UNSUPPORTED_ERROR ) {
3168 ec = U_ZERO_ERROR;
3169 NumberingSystem *ns = NumberingSystem::createInstance(ec);
3170 if (U_FAILURE(ec)) {
3171 dataerrln("FAIL: NumberingSystem::createInstance(ec); - %s", u_errorName(ec));
3305 errln("FAIL: measure format parsing: '%s' ec: %s", formats[i], u_errorName(status));