Lines Matching refs:status
72 #define TEST_CHECK_STATUS {if (U_FAILURE(status)) {dataerrln("%s:%d: Test failure. status=%s", \
73 … __FILE__, __LINE__, u_errorName(status)); return;}}
85 UErrorCode status = U_ZERO_ERROR; in APITest() local
88 AlphabeticIndex *index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
90 lc = index->getBucketCount(status); in APITest()
98 status = U_ZERO_ERROR; in APITest()
100 Collator::createInstance(Locale::getGerman(), status)); in APITest()
103 index = new AlphabeticIndex(coll, status); in APITest()
107 1, index->getBucketCount(status)); in APITest()
114 status = U_ZERO_ERROR; in APITest()
115 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
119 index->addLabels(additions, status); in APITest()
121 lc = index->getBucketCount(status); in APITest()
124 31, index->getBucketCount(status)); in APITest()
131 status = U_ZERO_ERROR; in APITest()
132 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
134 AlphabeticIndex &aip = index->addLabels(Locale::getJapanese(), status); in APITest()
137 lc = index->getBucketCount(status); in APITest()
144 status = U_ZERO_ERROR; in APITest()
145 index = new AlphabeticIndex(Locale::getGerman(), status); in APITest()
147 Collator *germanCol = Collator::createInstance(Locale::getGerman(), status); in APITest()
160 index->setOverflowLabel(UNICODE_STRING_SIMPLE("O"), status); in APITest()
161 …->setUnderflowLabel(UNICODE_STRING_SIMPLE("U"), status).setInflowLabel(UNICODE_STRING_SIMPLE("I"),… in APITest()
185 status = U_ZERO_ERROR; in APITest()
186 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
188 index->addRecord(UnicodeString("Adam"), this, status); in APITest()
191 index->resetBucketIterator(status); in APITest()
193 index->nextBucket(status); // Move to underflow label in APITest()
194 index->nextBucket(status); // Move to "A" in APITest()
200 b = index->nextRecord(status); in APITest()
213 status = U_ZERO_ERROR; in APITest()
214 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
216 while (index->nextBucket(status)) { in APITest()
218 while (index->nextRecord(status)) { in APITest()
225 index->addRecord(adam, NULL, status); in APITest()
226 index->addRecord(baker, NULL, status); in APITest()
227 index->addRecord(charlie, NULL, status); in APITest()
228 index->addRecord(chad, NULL, status); in APITest()
231 index->resetBucketIterator(status); in APITest()
232 while (index->nextBucket(status)) { in APITest()
234 while (index->nextRecord(status)) { in APITest()
242 TEST_ASSERT(index->nextBucket(status) == FALSE); in APITest()
243 index->resetBucketIterator(status); in APITest()
245 TEST_ASSERT(index->nextBucket(status) == TRUE); in APITest()
247 index->clearRecords(status); in APITest()
249 index->resetBucketIterator(status); in APITest()
250 while (index->nextBucket(status)) { in APITest()
252 while (index->nextRecord(status)) { in APITest()
261 status = U_ZERO_ERROR; in APITest()
262 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
264 index->setUnderflowLabel(adam, status).setOverflowLabel(charlie, status); in APITest()
266 for (i=0; index->nextBucket(status); i++) { in APITest()
290 status = U_ZERO_ERROR; in APITest()
291 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
293 int32_t n = index->getBucketIndex(adam, status); in APITest()
296 n = index->getBucketIndex(baker, status); in APITest()
298 n = index->getBucketIndex(Cyrillic, status); in APITest()
300 n = index->getBucketIndex(zed, status); in APITest()
303 for (i=0; index->nextBucket(status); i++) { in APITest()
312 index = new AlphabeticIndex(Locale::createFromName("ru"), status); in APITest()
314 assertEquals("Russian index.getBucketCount()", 32, index->getBucketCount(status)); in APITest()
321 … if (index->getCollator().getReorderCodes(reorderCodes, UPRV_LENGTHOF(reorderCodes), status) > 0) { in APITest()
322 expectedLatinIndex = index->getBucketCount(status) - 1; in APITest()
324 n = index->getBucketIndex(adam, status); in APITest()
327 n = index->getBucketIndex(baker, status); in APITest()
329 n = index->getBucketIndex(Cyrillic, status); in APITest()
331 n = index->getBucketIndex(zed, status); in APITest()
349 UErrorCode status = U_ZERO_ERROR; in ManyLocalesTest() local
353 status = U_ZERO_ERROR; in ManyLocalesTest()
360 AlphabeticIndex index(loc, status); in ManyLocalesTest()
362 lc = index.getBucketCount(status); in ManyLocalesTest()
366 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in ManyLocalesTest()
372 while (index.nextBucket(status)) { in ManyLocalesTest()
430 UErrorCode status = U_ZERO_ERROR; in HackPinyinTest() local
431 AlphabeticIndex aindex(Locale::createFromName("zh"), status); in HackPinyinTest()
438 aindex.addRecord(names[nameCount], &names[nameCount], status); in HackPinyinTest()
440 if (U_FAILURE(status)) { in HackPinyinTest()
444 TEST_ASSERT(nameCount == aindex.getRecordCount(status)); in HackPinyinTest()
452 while (aindex.nextBucket(status)) { in HackPinyinTest()
459 while (aindex.nextRecord(status)) { in HackPinyinTest()
480 UErrorCode status = U_ZERO_ERROR; in TestBug9009() local
482 AlphabeticIndex aindex(loc, status); in TestBug9009()
484 aindex.nextBucket(status); // Crash here before bug was fixed. in TestBug9009()
528 UErrorCode status = U_ZERO_ERROR; in TestIndexCharactersList() local
534 AlphabeticIndex index(locale, status); in TestIndexCharactersList()
536 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestIndexCharactersList()
549 UErrorCode status = U_ZERO_ERROR; in TestHaniFirst() local
551 static_cast<RuleBasedCollator *>(Collator::createInstance(Locale::getRoot(), status))); in TestHaniFirst()
553 if (U_FAILURE(status)) { in TestHaniFirst()
554 dataerrln("Failed Collator::createInstance call - %s", u_errorName(status)); in TestHaniFirst()
558 coll->setReorderCodes(reorderCodes, UPRV_LENGTHOF(reorderCodes), status); in TestHaniFirst()
560 AlphabeticIndex index(coll.orphan(), status); in TestHaniFirst()
562 assertEquals("getBucketCount()", 1, index.getBucketCount(status)); // ... (underflow only) in TestHaniFirst()
563 index.addLabels(Locale::getEnglish(), status); in TestHaniFirst()
564 assertEquals("getBucketCount()", 28, index.getBucketCount(status)); // ... A-Z ... in TestHaniFirst()
565 int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x897f), status); in TestHaniFirst()
567 bucketIndex = index.getBucketIndex("i", status); in TestHaniFirst()
569 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status); in TestHaniFirst()
572 bucketIndex = index.getBucketIndex(UnicodeString((UChar32)0x50005), status); in TestHaniFirst()
574 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status); in TestHaniFirst()
579 UErrorCode status = U_ZERO_ERROR; in TestPinyinFirst() local
581 static_cast<RuleBasedCollator *>(Collator::createInstance(Locale::getChinese(), status))); in TestPinyinFirst()
582 if (U_FAILURE(status)) { in TestPinyinFirst()
583 dataerrln("Failed Collator::createInstance call - %s", u_errorName(status)); in TestPinyinFirst()
587 coll->setReorderCodes(reorderCodes, UPRV_LENGTHOF(reorderCodes), status); in TestPinyinFirst()
589 AlphabeticIndex index(coll.orphan(), status); in TestPinyinFirst()
591 assertEquals("getBucketCount()", 28, index.getBucketCount(status)); // ... A-Z ... in TestPinyinFirst()
592 index.addLabels(Locale::getChinese(), status); in TestPinyinFirst()
593 assertEquals("getBucketCount()", 28, index.getBucketCount(status)); // ... A-Z ... in TestPinyinFirst()
594 int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x897f), status); in TestPinyinFirst()
596 bucketIndex = index.getBucketIndex("i", status); in TestPinyinFirst()
598 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status); in TestPinyinFirst()
601 bucketIndex = index.getBucketIndex(UnicodeString((UChar32)0x50005), status); in TestPinyinFirst()
603 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status); in TestPinyinFirst()
608 UErrorCode status = U_ZERO_ERROR; in TestSchSt() local
609 AlphabeticIndex index(Locale::getGerman(), status); in TestSchSt()
610 index.addLabels(UnicodeSet("[\\u00C6{Sch*}{St*}]", status), status); in TestSchSt()
613 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestSchSt()
615 assertEquals("getBucketCount()", 31, index.getBucketCount(status)); in TestSchSt()
642 assertEquals(msg, testCase.bucketIndex, index.getBucketIndex(name, status)); in TestSchSt()
644 assertEquals(msg, testCase.bucketIndex, immIndex->getBucketIndex(name, status)); in TestSchSt()
651 UErrorCode status = U_ZERO_ERROR; in TestNoLabels() local
653 static_cast<RuleBasedCollator *>(Collator::createInstance(Locale::getRoot(), status))); in TestNoLabels()
655 AlphabeticIndex index(coll.orphan(), status); in TestNoLabels()
657 index.addRecord(UnicodeString((UChar)0x897f), NULL, status); in TestNoLabels()
658 index.addRecord("i", NULL, status); in TestNoLabels()
659 index.addRecord(UnicodeString((UChar)0x03B1), NULL, status); in TestNoLabels()
660 assertEquals("getBucketCount()", 1, index.getBucketCount(status)); // ... in TestNoLabels()
661 TEST_ASSERT(index.nextBucket(status)); in TestNoLabels()
667 UErrorCode status = U_ZERO_ERROR; in TestChineseZhuyin() local
669 uloc_forLanguageTag("zh-u-co-zhuyin", loc, UPRV_LENGTHOF(loc), NULL, &status); in TestChineseZhuyin()
670 AlphabeticIndex index(loc, status); in TestChineseZhuyin()
671 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestChineseZhuyin()
682 UErrorCode status = U_ZERO_ERROR; in TestJapaneseKanji() local
683 AlphabeticIndex index(Locale::getJapanese(), status); in TestJapaneseKanji()
684 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestJapaneseKanji()
693 assertEquals(msg, overflowIndex, immIndex->getBucketIndex(UnicodeString(kanji[i]), status)); in TestJapaneseKanji()
699 UErrorCode status = U_ZERO_ERROR; in TestChineseUnihan() local
700 AlphabeticIndex index("zh-u-co-unihan", status); in TestChineseUnihan()
701 if(U_FAILURE(status)) { in TestChineseUnihan()
702 dataerrln("unable create an AlphabeticIndex for Chinese/unihan: %s", u_errorName(status)); in TestChineseUnihan()
705 index.setMaxLabelCount(500, status); // ICU 54 default is 99. in TestChineseUnihan()
706 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestChineseUnihan()
720 int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x4e5d), status); in TestChineseUnihan()
723 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x7527), status); in TestChineseUnihan()