Lines Matching full:status
38 UErrorCode status = U_ZERO_ERROR; in runIndexedTest() local
40 Locale::setDefault(Locale::getEnglish(), status); in runIndexedTest()
41 if(U_FAILURE(status)) { in runIndexedTest()
45 Locale::setDefault(saveLocale, status); in runIndexedTest()
100 UErrorCode status = U_ZERO_ERROR; in testAPI() local
106 DecimalFormat def(status); in testAPI()
107 if(U_FAILURE(status)) { in testAPI()
108 … errcheckln(status, "ERROR: Could not create DecimalFormat (default) - %s", u_errorName(status)); in testAPI()
113 status = U_ZERO_ERROR; in testAPI()
114 DecimalFormat noGrouping("###0.##", status); in testAPI()
124 status = U_ZERO_ERROR; in testAPI()
126 DecimalFormat pat(pattern, status); in testAPI()
127 if(U_FAILURE(status)) { in testAPI()
132 status = U_ZERO_ERROR; in testAPI()
133 DecimalFormatSymbols *symbols = new DecimalFormatSymbols(Locale::getFrench(), status); in testAPI()
134 if(U_FAILURE(status)) { in testAPI()
139 status = U_ZERO_ERROR; in testAPI()
140 DecimalFormat cust1(pattern, symbols, status); in testAPI()
141 if(U_FAILURE(status)) { in testAPI()
145 status = U_ZERO_ERROR; in testAPI()
146 DecimalFormat cust2(pattern, *symbols, status); in testAPI()
147 if(U_FAILURE(status)) { in testAPI()
190 status = U_ZERO_ERROR; in testAPI()
191 res3 = cust1.format(fD, res3, pos3, status); in testAPI()
192 if(U_FAILURE(status)) { in testAPI()
197 status = U_ZERO_ERROR; in testAPI()
198 res4 = cust2.format(fL, res4, pos4, status); in testAPI()
199 if(U_FAILURE(status)) { in testAPI()
212 status = U_ZERO_ERROR; in testAPI()
213 pat.applyPattern(patt, status); in testAPI()
214 if(U_FAILURE(status)) { in testAPI()
223 status = U_ZERO_ERROR; in testAPI()
224 pat.parse(text, result2, status); in testAPI()
225 if(U_FAILURE(status)) { in testAPI()
348 status = U_ZERO_ERROR; in testAPI()
349 pat.applyPattern(p1, status); in testAPI()
350 if(U_FAILURE(status)) { in testAPI()
351 errln((UnicodeString)"ERROR: applyPattern() failed with " + (int32_t) status); in testAPI()
370 status = U_ZERO_ERROR; in testAPI()
371 pat.applyLocalizedPattern(p2, status); in testAPI()
372 if(U_FAILURE(status)) { in testAPI()
373 errln((UnicodeString)"ERROR: applyPattern() failed with " + (int32_t) status); in testAPI()
382 status = U_ZERO_ERROR; in testAPI()
384 pat.applyLocalizedPattern(p2, pe, status); in testAPI()
385 if(U_FAILURE(status)) { in testAPI()
386 … errln((UnicodeString)"ERROR: applyPattern((with ParseError)) failed with " + (int32_t) status); in testAPI()
407 status = U_ZERO_ERROR; in testAPI()
408 NumberFormat *test = new DecimalFormat(status); in testAPI()
409 if(U_FAILURE(status)) { in testAPI()
421 UErrorCode status = U_ZERO_ERROR; in TestCurrencyPluralInfo() local
423 CurrencyPluralInfo *cpi = new CurrencyPluralInfo(status); in TestCurrencyPluralInfo()
424 if(U_FAILURE(status)) { in TestCurrencyPluralInfo()
434 cpi->setCurrencyPluralPattern("","",status); in TestCurrencyPluralInfo()
435 if(U_FAILURE(status)) { in TestCurrencyPluralInfo()
439 cpi->setLocale(Locale::getCanada(), status); in TestCurrencyPluralInfo()
440 if(U_FAILURE(status)) { in TestCurrencyPluralInfo()
444 cpi->setPluralRules("",status); in TestCurrencyPluralInfo()
445 if(U_FAILURE(status)) { in TestCurrencyPluralInfo()
449 DecimalFormat *df = new DecimalFormat(status); in TestCurrencyPluralInfo()
450 if(U_FAILURE(status)) { in TestCurrencyPluralInfo()
451 errcheckln(status, "ERROR: Could not create DecimalFormat - %s", u_errorName(status)); in TestCurrencyPluralInfo()
466 UErrorCode status = U_ZERO_ERROR; in testRounding() local
478 DecimalFormat pat(status); in testRounding()
479 if(U_FAILURE(status)) { in testRounding()
480 … errcheckln(status, "ERROR: Could not create DecimalFormat (default) - %s", u_errorName(status)); in testRounding()
529 UErrorCode status = U_ZERO_ERROR; in testRoundingInc() local
530 DecimalFormat pat(UnicodeString("#,##0.00"),status); in testRoundingInc()
531 if(U_FAILURE(status)) { in testRoundingInc()
532 … errcheckln(status, "ERROR: Could not create DecimalFormat (default) - %s", u_errorName(status)); in testRoundingInc()
575 UErrorCode status = U_ZERO_ERROR; in TestScale() local
576 DecimalFormat pat(status); in TestScale()
577 if(U_FAILURE(status)) { in TestScale()
578 … errcheckln(status, "ERROR: Could not create DecimalFormat (default) - %s", u_errorName(status)); in TestScale()
590 pat.applyPattern(percentPattern,status); in TestScale()
592 pat.setAttribute(UNUM_SCALE,testData[i].inputScale,status); in TestScale()
609 UErrorCode status = U_ZERO_ERROR; in TestFixedDecimal() local
611 LocalPointer<DecimalFormat> df(new DecimalFormat("###", status), status); in TestFixedDecimal()
612 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
613 if (status == U_MISSING_RESOURCE_ERROR) { in TestFixedDecimal()
616 FixedDecimal fd = df->getFixedDecimal(44, status); in TestFixedDecimal()
617 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
622 fd = df->getFixedDecimal(-44, status); in TestFixedDecimal()
623 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
628 df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###.00##", status), status); in TestFixedDecimal()
629 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
630 fd = df->getFixedDecimal(123.456, status); in TestFixedDecimal()
631 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
640 fd = df->getFixedDecimal(-123.456, status); in TestFixedDecimal()
641 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
652 fd = df->getFixedDecimal(123.456, status); in TestFixedDecimal()
653 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
662 fd = df->getFixedDecimal(-123.456, status); in TestFixedDecimal()
663 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
675 fd = df->getFixedDecimal(123.456, status); in TestFixedDecimal()
676 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
685 fd = df->getFixedDecimal(-123.456, status); in TestFixedDecimal()
686 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
699 fd = df->getFixedDecimal(30.0, status); in TestFixedDecimal()
700 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
709 fd = df->getFixedDecimal(-30.0, status); in TestFixedDecimal()
710 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
719 df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###", status), status); in TestFixedDecimal()
720 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
721 fd = df->getFixedDecimal(123.456, status); in TestFixedDecimal()
722 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
730 df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###.0", status), status); in TestFixedDecimal()
731 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
732 fd = df->getFixedDecimal(123.01, status); in TestFixedDecimal()
733 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
741 df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###.0", status), status); in TestFixedDecimal()
742 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
743 fd = df->getFixedDecimal(123.06, status); in TestFixedDecimal()
744 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
752 …df.adoptInsteadAndCheckErrorCode(new DecimalFormat("@@@@@", status), status); // Significant Digi… in TestFixedDecimal()
753 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
754 fd = df->getFixedDecimal(123, status); in TestFixedDecimal()
755 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
763 …df.adoptInsteadAndCheckErrorCode(new DecimalFormat("@@@@@", status), status); // Significant Digi… in TestFixedDecimal()
764 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
765 fd = df->getFixedDecimal(1.23, status); in TestFixedDecimal()
766 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
774 fd = df->getFixedDecimal(uprv_getInfinity(), status); in TestFixedDecimal()
775 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
777 fd = df->getFixedDecimal(0.0, status); in TestFixedDecimal()
779 fd = df->getFixedDecimal(uprv_getNaN(), status); in TestFixedDecimal()
781 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
787 new DecimalFormat("#####################0.00####################", status), status); in TestFixedDecimal()
788 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
789 Formattable fable("12.34", status); in TestFixedDecimal()
790 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
791 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
792 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
800 fable.setDecimalNumber("12.345678901234567890123456789", status); in TestFixedDecimal()
801 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
802 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
803 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
812 fable.setDecimalNumber("123456789012345678901234567890.123456789012345678901234567890", status); in TestFixedDecimal()
813 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
814 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
815 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
824 fable.setDecimalNumber("1.0000000000000000000012", status); in TestFixedDecimal()
825 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
826 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
827 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
836 fable.setDecimalNumber("1.000000000000000000000012", status); in TestFixedDecimal()
837 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
838 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
839 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
848 fable.setDecimalNumber("-1.0000000000000000000012", status); in TestFixedDecimal()
849 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
850 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
851 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
860 fable.setDecimalNumber("1000000000000000000000.3", status); in TestFixedDecimal()
861 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
862 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
863 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
871 fable.setDecimalNumber("1000000000000000050000.3", status); in TestFixedDecimal()
872 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
873 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
874 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
884 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
885 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
886 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
895 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
896 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
897 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
906 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
907 fd = df->getFixedDecimal(fable, status); in TestFixedDecimal()
908 TEST_ASSERT_STATUS(status); in TestFixedDecimal()
924 UErrorCode status = U_ZERO_ERROR; in TestBadFastpath() local
926 LocalPointer<DecimalFormat> df(new DecimalFormat("###", status), status); in TestBadFastpath()
927 if (U_FAILURE(status)) { in TestBadFastpath()
928 dataerrln("Error creating new DecimalFormat - %s", u_errorName(status)); in TestBadFastpath()
945 UErrorCode status = U_ZERO_ERROR; in TestRequiredDecimalPoint() local
951 LocalPointer<DecimalFormat> df(new DecimalFormat(pat1, status), status); in TestRequiredDecimalPoint()
952 if (U_FAILURE(status)) { in TestRequiredDecimalPoint()
953 dataerrln("Error creating new DecimalFormat - %s", u_errorName(status)); in TestRequiredDecimalPoint()
957 status = U_ZERO_ERROR; in TestRequiredDecimalPoint()
958 df->applyPattern(pat1, status); in TestRequiredDecimalPoint()
959 if(U_FAILURE(status)) { in TestRequiredDecimalPoint()
962 df->parse(text, result1, status); in TestRequiredDecimalPoint()
963 if(U_FAILURE(status)) { in TestRequiredDecimalPoint()
967 df->parse(text, result1, status); in TestRequiredDecimalPoint()
968 if(U_SUCCESS(status)) { in TestRequiredDecimalPoint()
973 status = U_ZERO_ERROR; in TestRequiredDecimalPoint()
974 df->applyPattern(pat2, status); in TestRequiredDecimalPoint()
976 if(U_FAILURE(status)) { in TestRequiredDecimalPoint()
979 df->parse(text, result1, status); in TestRequiredDecimalPoint()
980 if(U_FAILURE(status)) { in TestRequiredDecimalPoint()
981 errln((UnicodeString)"ERROR: parse(2) failed - " + u_errorName(status)); in TestRequiredDecimalPoint()
984 df->parse(text, result1, status); in TestRequiredDecimalPoint()
985 if(U_SUCCESS(status)) { in TestRequiredDecimalPoint()