Lines Matching full:pluralformat
35 if (exec) logln("TestSuite PluralFormat");
48 * Test various generic API methods of PluralFormat for Basic usage.
53 PluralFormat* plFmt[8];
56 UnicodeString message=UnicodeString("ERROR: PluralFormat basic test");
59 logln(" Testing PluralFormat constructors ...");
72 plFmt[0] = new PluralFormat(status[0]);
73 plFmt[1] = new PluralFormat(*plRules, status[1]);
74 plFmt[2] = new PluralFormat(locale, status[2]);
75 plFmt[3] = new PluralFormat(locale, *plRules, status[3]);
76 plFmt[4] = new PluralFormat(otherPattern, status[4]);
77 plFmt[5] = new PluralFormat(*plRules, otherPattern, status[5]);
78 plFmt[6] = new PluralFormat(locale, otherPattern, status[6]);
79 plFmt[7] = new PluralFormat(locale, *plRules, otherPattern, status[7]);
87 dataerrln("ERROR: PluralFormat constructor failed!");
92 plFmt[0]= new PluralFormat(status[0]);
96 plFmt[1]= new PluralFormat(locale, status[1]);
106 dataerrln("ERROR: PluralFormat constructor failed! - [0]%s [1]%s", u_errorName(status[0]), u_errorName(status[1]));
111 plFmt[0]= new PluralFormat(locale, status[0]);
121 dataerrln("ERROR: PluralFormat constructor failed! - %s", u_errorName(status[1]));
125 plFmt[2] = (PluralFormat*) plFmt[1]->clone();
136 dataerrln("ERROR: PluralFormat clone failed! - %s", u_errorName(status[1]));
145 PluralFormat *pf = new PluralFormat(stat);
150 dataerrln("ERROR: PluralFormat::parseObject: %s", u_errorName(stat));
158 * Unit tests of PluralFormat class.
206 PluralFormat plFmt=PluralFormat(*plRules, status);
208 dataerrln("ERROR: PluralFormat constructor failed in unit tests.- exitting");
213 errln("ERROR: PluralFormat failed to detect syntax error with pattern: "+checkSyntaxtData[i]);
225 UnicodeString message=UnicodeString("ERROR: PluralFormat tests various pattern ...");
231 PluralFormat plFmt=PluralFormat(*plRules, status);
233 dataerrln("ERROR: PluralFormat constructor failed in unit tests.- exitting");
238 errln("ERROR: PluralFormat failed to apply pattern- "+patternTestData[i]);
250 PluralFormat pluralFmt = PluralFormat(*plRules, status);
252 dataerrln("ERROR: Could not create PluralFormat instance in setLocale() test - exitting. ");
298 logln("Test copy constructor and == operator of PluralFormat");
299 PluralFormat dupPFmt = PluralFormat(pluralFmt);
301 errln("Failed in PluralFormat copy constructor or == operator");
311 * Test locale data used in PluralFormat class.
527 PluralFormat plFmt(ulocale, testPattern, status);
564 PluralFormat pf(Locale::getEnglish(), fmtString, status);
576 errln("PluralFormat.format(value %d) failed - %s", i, u_errorName(status));
581 UnicodeString message("PluralFormat.format(): Expected '", -1, US_INV);
619 PluralFormat pf(fmt, status);
630 PluralFormat pf(Locale::getEnglish(), UPLURAL_TYPE_ORDINAL, pattern, errorCode);
631 if (errorCode.logDataIfFailureAndReset("PluralFormat(en, UPLURAL_TYPE_ORDINAL, pattern) failed")) {
635 if (!errorCode.logIfFailureAndReset("PluralFormat.format(321) failed") &&
637 errln(UnicodeString("PluralFormat.format(321) wrong result string: ") + result);
640 if (!errorCode.logIfFailureAndReset("PluralFormat.format(22) failed") &&
642 errln(UnicodeString("PluralFormat.format(22) wrong result string: ") + result);
645 if (!errorCode.logIfFailureAndReset("PluralFormat.format(3) failed") &&
647 errln(UnicodeString("PluralFormat.format(3) wrong result string: ") + result);
651 PluralFormat pf2(Locale::getEnglish(), UPLURAL_TYPE_ORDINAL, errorCode);
653 if (errorCode.logIfFailureAndReset("PluralFormat(en, UPLURAL_TYPE_ORDINAL, pattern) failed")) {
657 if (!errorCode.logIfFailureAndReset("PluralFormat.format(456) failed") &&
659 errln(UnicodeString("PluralFormat.format(456) wrong result string: ") + result);
662 if (!errorCode.logIfFailureAndReset("PluralFormat.format(111) failed") &&
664 errln(UnicodeString("PluralFormat.format(111) wrong result string: ") + result);
672 PluralFormat pf(Locale::getEnglish(), "one{one meter}other{# meters}", errorCode);
675 PluralFormat pf2(Locale::getEnglish(),
686 PluralFormatTest::numberFormatTest(PluralFormat* plFmt,
697 dataerrln("ERROR: Could not create PluralFormat or NumberFormat - exitting");
757 PluralFormat plFmt(ulocale, testPattern, status);