Lines Matching refs:status

121     UErrorCode status = U_ZERO_ERROR;  in testAPI()  local
129 PluralRules defRule(status); in testAPI()
130 LocalPointer<PluralRules> test(new PluralRules(status), status); in testAPI()
131 if(U_FAILURE(status)) { in testAPI()
135 LocalPointer<PluralRules> newEnPlural(test->forLocale(Locale::getEnglish(), status), status); in testAPI()
136 if(U_FAILURE(status)) { in testAPI()
161 LocalPointer<PluralRules> empRule(test->createRules(UNICODE_STRING_SIMPLE("a:n"), status)); in testAPI()
177 LocalPointer<PluralRules> newRules(test->createRules(pluralTestData[i], status)); in testAPI()
206 LocalPointer<PluralRules> newRules(test->createRules(complexRule, status)); in testAPI()
211 newRules.adoptInstead(test->createRules(complexRule2, status)); in testAPI()
220 status = U_ZERO_ERROR; in testAPI()
221 newRules.adoptInstead(test->createRules(decimalRule, status)); in testAPI()
222 if (U_FAILURE(status)) { in testAPI()
251 LocalPointer<PluralRules> en_UK(test->forLocale(Locale::getUK(), status)); in testAPI()
252 LocalPointer<PluralRules> en(test->forLocale(Locale::getEnglish(), status)); in testAPI()
259 LocalPointer<PluralRules> zh_Hant(test->forLocale(Locale::getTaiwan(), status)); in testAPI()
260 LocalPointer<PluralRules> zh(test->forLocale(Locale::getChinese(), status)); in testAPI()
312 UErrorCode status = U_ZERO_ERROR; in testEquality() local
323 rules[totalRules]=test.createRules(testEquRules[i][totalRules], status); in testEquality()
356 UErrorCode status = U_ZERO_ERROR; in assertRuleKeyValue() local
357 PluralRules *pr = PluralRules::createRules(rule, status); in assertRuleKeyValue()
388 UErrorCode status = U_ZERO_ERROR; in testGetSamples() local
393 for (int32_t i = 0; U_SUCCESS(status) && i < numLocales; ++i) { in testGetSamples()
394 PluralRules *rules = PluralRules::forLocale(locales[i], status); in testGetSamples()
395 if (U_FAILURE(status)) { in testGetSamples()
398 StringEnumeration *keywords = rules->getKeywords(status); in testGetSamples()
399 if (U_FAILURE(status)) { in testGetSamples()
404 while (NULL != (keyword = keywords->snext(status))) { in testGetSamples()
405 int32_t count = rules->getSamples(*keyword, values, UPRV_LENGTHOF(values), status); in testGetSamples()
406 if (U_FAILURE(status)) { in testGetSamples()
446 UErrorCode status = U_ZERO_ERROR; in testWithin() local
447 PluralRules *rules = PluralRules::createRules("a: n mod 10 in 5..8", status); in testWithin()
490 UErrorCode status = U_ZERO_ERROR; in testGetAllKeywordValues() local
496 PluralRules *p = PluralRules::createRules(ruleDescription, status); in testGetAllKeywordValues()
497 if (p == NULL || U_FAILURE(status)) { in testGetAllKeywordValues()
500 __FILE__, __LINE__, data[i], u_errorName(status)); in testGetAllKeywordValues()
518 status = U_ZERO_ERROR; in testGetAllKeywordValues()
521 int32_t count = p->getAllKeywordValues(keyword, &samples[0], 4, status); in testGetAllKeywordValues()
522 if (U_FAILURE(status)) { in testGetAllKeywordValues()
608 void PluralRulesTest::checkSelect(const LocalPointer<PluralRules> &rules, UErrorCode &status, in checkSelect() argument
616 if (U_FAILURE(status)) { in checkSelect()
617 errln("file %s, line %d, ICU error status: %s.", __FILE__, line, u_errorName(status)); in checkSelect()
618 status = U_ZERO_ERROR; in checkSelect()
637 dl.set(StringPiece(num), status); in checkSelect()
638 if (U_FAILURE(status)) { in checkSelect()
639 errln("file %s, line %d, ICU error status: %s.", __FILE__, line, u_errorName(status)); in checkSelect()
640 status = U_ZERO_ERROR; in checkSelect()
659 UErrorCode status = U_ZERO_ERROR; in testSelect() local
660 LocalPointer<PluralRules> pr(PluralRules::createRules("s: n in 1,3,4,6", status)); in testSelect()
661 checkSelect(pr, status, __LINE__, "s", "1.0", "3.0", "4.0", "6.0", END_MARK); in testSelect()
662 checkSelect(pr, status, __LINE__, "other", "0.0", "2.0", "3.1", "7.0", END_MARK); in testSelect()
664 pr.adoptInstead(PluralRules::createRules("s: n not in 1,3,4,6", status)); in testSelect()
665 checkSelect(pr, status, __LINE__, "other", "1.0", "3.0", "4.0", "6.0", END_MARK); in testSelect()
666 checkSelect(pr, status, __LINE__, "s", "0.0", "2.0", "3.1", "7.0", END_MARK); in testSelect()
669 "s: n is 29;", status)); in testSelect()
670 …checkSelect(pr, status, __LINE__, "r", "1.0", "3.0", "7.0", "8.0", "10.0", "14.0", "17.0", END_MAR… in testSelect()
671 checkSelect(pr, status, __LINE__, "s", "29.0", END_MARK); in testSelect()
672 checkSelect(pr, status, __LINE__, "other", "28.0", "29.1", END_MARK); in testSelect()
674 pr.adoptInstead(PluralRules::createRules("a: n mod 10 is 1; b: n mod 100 is 0 ", status)); in testSelect()
675 checkSelect(pr, status, __LINE__, "a", "1", "11", "41", "101", "301.00", END_MARK); in testSelect()
676 …checkSelect(pr, status, __LINE__, "b", "0", "100", "200.0", "300.", "1000", "1100", "110000", END_… in testSelect()
677 …checkSelect(pr, status, __LINE__, "other", "0.01", "1.01", "0.99", "2", "3", "99", "102", END_MARK… in testSelect()
681 pr.adoptInstead(PluralRules::createRules("a: n is 1", status)); in testSelect()
682 checkSelect(pr, status, __LINE__, "a", "1", END_MARK); in testSelect()
683 checkSelect(pr, status, __LINE__, "other", "2", END_MARK); in testSelect()
685 pr.adoptInstead(PluralRules::createRules("a: n is 1 ", status)); in testSelect()
686 checkSelect(pr, status, __LINE__, "a", "1", END_MARK); in testSelect()
687 checkSelect(pr, status, __LINE__, "other", "2", END_MARK); in testSelect()
689 pr.adoptInstead(PluralRules::createRules("a: n is 1;", status)); in testSelect()
690 checkSelect(pr, status, __LINE__, "a", "1", END_MARK); in testSelect()
691 checkSelect(pr, status, __LINE__, "other", "2", END_MARK); in testSelect()
693 pr.adoptInstead(PluralRules::createRules("a: n is 1 ; ", status)); in testSelect()
694 checkSelect(pr, status, __LINE__, "a", "1", END_MARK); in testSelect()
695 checkSelect(pr, status, __LINE__, "other", "2", END_MARK); in testSelect()
699 ….adoptInstead(PluralRules::createRules("c: n in 5..15; b : n in 1..10 ;a:n in 10 .. 20", status)); in testSelect()
700 checkSelect(pr, status, __LINE__, "a", "20", END_MARK); in testSelect()
701 checkSelect(pr, status, __LINE__, "b", "1", END_MARK); in testSelect()
702 checkSelect(pr, status, __LINE__, "c", "10", END_MARK); in testSelect()
703 checkSelect(pr, status, __LINE__, "other", "0", "21", "10.1", END_MARK); in testSelect()
706 pr.adoptInstead(PluralRules::createRules("a: n in 2..10; b: n within 8..15", status)); in testSelect()
707 checkSelect(pr, status, __LINE__, "a", "2", "8", "10", END_MARK); in testSelect()
708 checkSelect(pr, status, __LINE__, "b", "8.01", "9.5", "11", "14.99", "15", END_MARK); in testSelect()
709 checkSelect(pr, status, __LINE__, "other", "1", "7.7", "15.01", "16", END_MARK); in testSelect()
712 …r.adoptInstead(PluralRules::createRules("a: n in 2..10 and n in 4..12 and n not in 5..7", status)); in testSelect()
713 checkSelect(pr, status, __LINE__, "a", "4", "8", "9", "10", END_MARK); in testSelect()
714 checkSelect(pr, status, __LINE__, "other", "2", "3", "5", "7", "11", END_MARK); in testSelect()
715 …doptInstead(PluralRules::createRules("a: n is 2 or n is 5 or n in 7..11 and n in 11..13", status)); in testSelect()
716 checkSelect(pr, status, __LINE__, "a", "2", "5", "11", END_MARK); in testSelect()
717 checkSelect(pr, status, __LINE__, "other", "3", "4", "6", "8", "10", "12", "13", END_MARK); in testSelect()
728 pr.adoptInstead(PluralRules::createRules("a: i is 123", status)); in testSelect()
729 checkSelect(pr, status, __LINE__, "a", "123", "123.0", "123.1", "0123.99", END_MARK); in testSelect()
730 checkSelect(pr, status, __LINE__, "other", "124", "122.0", END_MARK); in testSelect()
732 pr.adoptInstead(PluralRules::createRules("a: f is 120", status)); in testSelect()
733 checkSelect(pr, status, __LINE__, "a", "1.120", "0.120", "11123.120", "0123.120", END_MARK); in testSelect()
734 checkSelect(pr, status, __LINE__, "other", "1.121", "122.1200", "1.12", "120", END_MARK); in testSelect()
736 pr.adoptInstead(PluralRules::createRules("a: t is 12", status)); in testSelect()
737 … checkSelect(pr, status, __LINE__, "a", "1.120", "0.12", "11123.12000", "0123.1200000", END_MARK); in testSelect()
738 checkSelect(pr, status, __LINE__, "other", "1.121", "122.1200001", "1.11", "12", END_MARK); in testSelect()
740 pr.adoptInstead(PluralRules::createRules("a: v is 3", status)); in testSelect()
741 …checkSelect(pr, status, __LINE__, "a", "1.120", "0.000", "11123.100", "0123.124", ".666", END_MARK… in testSelect()
742 … checkSelect(pr, status, __LINE__, "other", "1.1212", "122.12", "1.1", "122", "0.0000", END_MARK); in testSelect()
744 pr.adoptInstead(PluralRules::createRules("a: v is 0 and i is 123", status)); in testSelect()
745 checkSelect(pr, status, __LINE__, "a", "123", "123.", END_MARK); in testSelect()
746 checkSelect(pr, status, __LINE__, "other", "123.0", "123.1", "123.123", "0.123", END_MARK); in testSelect()
751 , status)); in testSelect()
752 checkSelect(pr, status, __LINE__, "other", "20", "29", END_MARK); in testSelect()
753 checkSelect(pr, status, __LINE__, "a", "21", END_MARK); in testSelect()
754 checkSelect(pr, status, __LINE__, "n", "22", END_MARK); in testSelect()
755 checkSelect(pr, status, __LINE__, "i", "23", END_MARK); in testSelect()
756 checkSelect(pr, status, __LINE__, "f", "24", END_MARK); in testSelect()
757 checkSelect(pr, status, __LINE__, "t", "25", END_MARK); in testSelect()
758 checkSelect(pr, status, __LINE__, "v", "26", END_MARK); in testSelect()
759 checkSelect(pr, status, __LINE__, "w", "27", END_MARK); in testSelect()
760 checkSelect(pr, status, __LINE__, "j", "28", END_MARK); in testSelect()
765 , status)); in testSelect()
766 checkSelect(pr, status, __LINE__, "other", "30", "39", END_MARK); in testSelect()
767 checkSelect(pr, status, __LINE__, "not", "31", END_MARK); in testSelect()
768 checkSelect(pr, status, __LINE__, "and", "32", END_MARK); in testSelect()
769 checkSelect(pr, status, __LINE__, "or", "33", END_MARK); in testSelect()
770 checkSelect(pr, status, __LINE__, "mod", "34", END_MARK); in testSelect()
771 checkSelect(pr, status, __LINE__, "in", "35", END_MARK); in testSelect()
772 checkSelect(pr, status, __LINE__, "within", "36", END_MARK); in testSelect()
773 checkSelect(pr, status, __LINE__, "is", "37", END_MARK); in testSelect()
777 pr.adoptInstead(PluralRules::createRules("a: n is 1", status)); in testSelect()
778 checkSelect(pr, status, __LINE__, "a", "1", END_MARK); in testSelect()
779 pr.adoptInstead(PluralRules::createRules("a: n mod 10 is 2", status)); in testSelect()
780 checkSelect(pr, status, __LINE__, "a", "2", "12", "22", END_MARK); in testSelect()
781 pr.adoptInstead(PluralRules::createRules("a: n is not 1", status)); in testSelect()
782 checkSelect(pr, status, __LINE__, "a", "0", "2", "3", "4", "5", END_MARK); in testSelect()
783 pr.adoptInstead(PluralRules::createRules("a: n mod 3 is not 1", status)); in testSelect()
784 checkSelect(pr, status, __LINE__, "a", "0", "2", "3", "5", "6", "8", "9", END_MARK); in testSelect()
785 pr.adoptInstead(PluralRules::createRules("a: n in 2..5", status)); in testSelect()
786 checkSelect(pr, status, __LINE__, "a", "2", "3", "4", "5", END_MARK); in testSelect()
787 pr.adoptInstead(PluralRules::createRules("a: n within 2..5", status)); in testSelect()
788 checkSelect(pr, status, __LINE__, "a", "2", "3", "4", "5", END_MARK); in testSelect()
789 pr.adoptInstead(PluralRules::createRules("a: n not in 2..5", status)); in testSelect()
790 checkSelect(pr, status, __LINE__, "a", "0", "1", "6", "7", "8", END_MARK); in testSelect()
791 pr.adoptInstead(PluralRules::createRules("a: n not within 2..5", status)); in testSelect()
792 checkSelect(pr, status, __LINE__, "a", "0", "1", "6", "7", "8", END_MARK); in testSelect()
793 pr.adoptInstead(PluralRules::createRules("a: n mod 10 in 2..5", status)); in testSelect()
794 …checkSelect(pr, status, __LINE__, "a", "2", "3", "4", "5", "12", "13", "14", "15", "22", "23", "24… in testSelect()
795 pr.adoptInstead(PluralRules::createRules("a: n mod 10 within 2..5", status)); in testSelect()
796 …checkSelect(pr, status, __LINE__, "a", "2", "3", "4", "5", "12", "13", "14", "15", "22", "23", "24… in testSelect()
797 pr.adoptInstead(PluralRules::createRules("a: n mod 10 is 2 and n is not 12", status)); in testSelect()
798 checkSelect(pr, status, __LINE__, "a", "2", "22", "32", "42", END_MARK); in testSelect()
799 pr.adoptInstead(PluralRules::createRules("a: n mod 10 in 2..3 or n mod 10 is 5", status)); in testSelect()
800 …checkSelect(pr, status, __LINE__, "a", "2", "3", "5", "12", "13", "15", "22", "23", "25", END_MARK… in testSelect()
801 pr.adoptInstead(PluralRules::createRules("a: n mod 10 within 2..3 or n mod 10 is 5", status)); in testSelect()
802 …checkSelect(pr, status, __LINE__, "a", "2", "3", "5", "12", "13", "15", "22", "23", "25", END_MARK… in testSelect()
803 pr.adoptInstead(PluralRules::createRules("a: n is 1 or n is 4 or n is 23", status)); in testSelect()
804 checkSelect(pr, status, __LINE__, "a", "1", "4", "23", END_MARK); in testSelect()
805 …pr.adoptInstead(PluralRules::createRules("a: n mod 2 is 1 and n is not 3 and n in 1..11", status)); in testSelect()
806 checkSelect(pr, status, __LINE__, "a", "1", "5", "7", "9", "11", END_MARK); in testSelect()
807 …doptInstead(PluralRules::createRules("a: n mod 2 is 1 and n is not 3 and n within 1..11", status)); in testSelect()
808 checkSelect(pr, status, __LINE__, "a", "1", "5", "7", "9", "11", END_MARK); in testSelect()
809 …r.adoptInstead(PluralRules::createRules("a: n mod 2 is 1 or n mod 5 is 1 and n is not 6", status)); in testSelect()
810 … checkSelect(pr, status, __LINE__, "a", "1", "3", "5", "7", "9", "11", "13", "15", "16", END_MARK); in testSelect()
811 … pr.adoptInstead(PluralRules::createRules("a: n in 2..5; b: n in 5..8; c: n mod 2 is 1", status)); in testSelect()
812 checkSelect(pr, status, __LINE__, "a", "2", "3", "4", "5", END_MARK); in testSelect()
813 checkSelect(pr, status, __LINE__, "b", "6", "7", "8", END_MARK); in testSelect()
814 checkSelect(pr, status, __LINE__, "c", "1", "9", "11", END_MARK); in testSelect()
815 …ptInstead(PluralRules::createRules("a: n within 2..5; b: n within 5..8; c: n mod 2 is 1", status)); in testSelect()
816 checkSelect(pr, status, __LINE__, "a", "2", "3", "4", "5", END_MARK); in testSelect()
817 checkSelect(pr, status, __LINE__, "b", "6", "7", "8", END_MARK); in testSelect()
818 checkSelect(pr, status, __LINE__, "c", "1", "9", "11", END_MARK); in testSelect()
819 … pr.adoptInstead(PluralRules::createRules("a: n in 2, 4..6; b: n within 7..9,11..12,20", status)); in testSelect()
820 checkSelect(pr, status, __LINE__, "a", "2", "4", "5", "6", END_MARK); in testSelect()
821 checkSelect(pr, status, __LINE__, "b", "7", "8", "9", "11", "12", "20", END_MARK); in testSelect()
822 pr.adoptInstead(PluralRules::createRules("a: n in 2..8, 12 and n not in 4..6", status)); in testSelect()
823 checkSelect(pr, status, __LINE__, "a", "2", "3", "7", "8", "12", END_MARK); in testSelect()
824 pr.adoptInstead(PluralRules::createRules("a: n mod 10 in 2, 3,5..7 and n is not 12", status)); in testSelect()
825 … checkSelect(pr, status, __LINE__, "a", "2", "3", "5", "6", "7", "13", "15", "16", "17", END_MARK); in testSelect()
826 pr.adoptInstead(PluralRules::createRules("a: n in 2..6, 3..7", status)); in testSelect()
827 checkSelect(pr, status, __LINE__, "a", "2", "3", "4", "5", "6", "7", END_MARK); in testSelect()
830 pr.adoptInstead(PluralRules::createRules("a: n = 1..8 and n!= 2,3,4,5", status)); in testSelect()
831 checkSelect(pr, status, __LINE__, "a", "1", "6", "7", "8", END_MARK); in testSelect()
832 checkSelect(pr, status, __LINE__, "other", "0", "2", "3", "4", "5", "9", END_MARK); in testSelect()
833 pr.adoptInstead(PluralRules::createRules("a:n % 10 != 1", status)); in testSelect()
834 checkSelect(pr, status, __LINE__, "a", "2", "6", "7", "8", END_MARK); in testSelect()
835 checkSelect(pr, status, __LINE__, "other", "1", "21", "211", "91", END_MARK); in testSelect()
842 UErrorCode status = U_ZERO_ERROR; in testAvailbleLocales() local
843 …eSet = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, uhash_compareLong, &status); in testAvailbleLocales()
845 if (U_FAILURE(status)) { in testAvailbleLocales()
846 errln("file %s, line %d: Error status = %s", __FILE__, __LINE__, u_errorName(status)); in testAvailbleLocales()
851 StringEnumeration *localesEnum = PluralRules::getAvailableLocales(status); in testAvailbleLocales()
854 const char *locale = localesEnum->next(NULL, status); in testAvailbleLocales()
855 if (U_FAILURE(status)) { in testAvailbleLocales()
856 … dataerrln("file %s, line %d: Error status = %s", __FILE__, __LINE__, u_errorName(status)); in testAvailbleLocales()
863 int32_t oldVal = uhash_puti(localeSet, new UnicodeString(locale), 1, &status); in testAvailbleLocales()
870 localesEnum->reset(status); in testAvailbleLocales()
872 while (localesEnum->next(NULL, status) != NULL) { in testAvailbleLocales()
873 if (U_FAILURE(status)) { in testAvailbleLocales()
874 errln("file %s, line %d: Error status = %s", __FILE__, __LINE__, u_errorName(status)); in testAvailbleLocales()
885 localesEnum->reset(status); in testAvailbleLocales()
887 status = U_ZERO_ERROR; in testAvailbleLocales()
888 const char *localeName = localesEnum->next(NULL, status); in testAvailbleLocales()
889 if (U_FAILURE(status)) { in testAvailbleLocales()
891 __FILE__, __LINE__, u_errorName(status), localeName); in testAvailbleLocales()
898 PluralRules *pr = PluralRules::forLocale(locale, status); in testAvailbleLocales()
899 if (U_FAILURE(status)) { in testAvailbleLocales()
901 __FILE__, __LINE__, u_errorName(status), localeName); in testAvailbleLocales()
948 UErrorCode status = U_ZERO_ERROR; in testParseErrors() local
949 PluralRules *pr = PluralRules::createRules(UnicodeString(rules), status); in testParseErrors()
950 if (U_SUCCESS(status)) { in testParseErrors()