• Home
  • Raw
  • Download

Lines Matching refs:index

32 UnicodeString joinLabelsAndAppend(AlphabeticIndex::ImmutableIndex &index, UnicodeString &dest) {  in joinLabelsAndAppend()  argument
35 for (int32_t i = 0; (bucket = index.getBucket(i)) != NULL; ++i) { in joinLabelsAndAppend()
52 void AlphabeticIndexTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par… in runIndexedTest() argument
86 AlphabeticIndex *index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest() local
88 lc = index->getBucketCount(status); in APITest()
92 delete index; in APITest()
101 index = new AlphabeticIndex(coll, status); in APITest()
103 TEST_ASSERT(coll == &index->getCollator()); in APITest()
105 1, index->getBucketCount(status)); in APITest()
107 delete index; in APITest()
113 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
117 index->addLabels(additions, status); in APITest()
119 lc = index->getBucketCount(status); in APITest()
122 31, index->getBucketCount(status)); in APITest()
124 delete index; in APITest()
130 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
132 AlphabeticIndex &aip = index->addLabels(Locale::getJapanese(), status); in APITest()
133 TEST_ASSERT(&aip == index); in APITest()
135 lc = index->getBucketCount(status); in APITest()
138 delete index; in APITest()
143 index = new AlphabeticIndex(Locale::getGerman(), status); in APITest()
147 const RuleBasedCollator &indexCol = index->getCollator(); in APITest()
152 UnicodeString s = index->getUnderflowLabel(); in APITest()
154 s = index->getOverflowLabel(); in APITest()
156 s = index->getInflowLabel(); in APITest()
158 index->setOverflowLabel(UNICODE_STRING_SIMPLE("O"), status); in APITest()
159index->setUnderflowLabel(UNICODE_STRING_SIMPLE("U"), status).setInflowLabel(UNICODE_STRING_SIMPLE(… in APITest()
160 s = index->getUnderflowLabel(); in APITest()
162 s = index->getOverflowLabel(); in APITest()
164 s = index->getInflowLabel(); in APITest()
170 delete index; in APITest()
184 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
186 index->addRecord(UnicodeString("Adam"), this, status); in APITest()
189 index->resetBucketIterator(status); in APITest()
191 index->nextBucket(status); // Move to underflow label in APITest()
192 index->nextBucket(status); // Move to "A" in APITest()
194 const UnicodeString &label2 = index->getBucketLabel(); in APITest()
198 b = index->nextRecord(status); in APITest()
201 const UnicodeString &itemName = index->getRecordName(); in APITest()
204 const void *itemContext = index->getRecordData(); in APITest()
207 delete index; in APITest()
212 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
214 while (index->nextBucket(status)) { in APITest()
216 while (index->nextRecord(status)) { in APITest()
223 index->addRecord(adam, NULL, status); in APITest()
224 index->addRecord(baker, NULL, status); in APITest()
225 index->addRecord(charlie, NULL, status); in APITest()
226 index->addRecord(chad, NULL, status); in APITest()
229 index->resetBucketIterator(status); in APITest()
230 while (index->nextBucket(status)) { in APITest()
232 while (index->nextRecord(status)) { in APITest()
240 TEST_ASSERT(index->nextBucket(status) == FALSE); in APITest()
241 index->resetBucketIterator(status); in APITest()
243 TEST_ASSERT(index->nextBucket(status) == TRUE); in APITest()
245 index->clearRecords(status); in APITest()
247 index->resetBucketIterator(status); in APITest()
248 while (index->nextBucket(status)) { in APITest()
250 while (index->nextRecord(status)) { in APITest()
255 delete index; in APITest()
260 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
262 index->setUnderflowLabel(adam, status).setOverflowLabel(charlie, status); in APITest()
264 for (i=0; index->nextBucket(status); i++) { in APITest()
266 UnicodeString label = index->getBucketLabel(); in APITest()
267 UAlphabeticIndexLabelType type = index->getBucketLabelType(); in APITest()
284 delete index; in APITest()
289 index = new AlphabeticIndex(Locale::getEnglish(), status); in APITest()
291 int32_t n = index->getBucketIndex(adam, status); in APITest()
294 n = index->getBucketIndex(baker, status); in APITest()
296 n = index->getBucketIndex(Cyrillic, status); in APITest()
298 n = index->getBucketIndex(zed, status); in APITest()
301 for (i=0; index->nextBucket(status); i++) { in APITest()
302 n = index->getBucketIndex(); in APITest()
304 UnicodeString label = index->getBucketLabel(); in APITest()
309 delete index; in APITest()
310 index = new AlphabeticIndex(Locale::createFromName("ru"), status); in APITest()
312 assertEquals("Russian index.getBucketCount()", 32, index->getBucketCount(status)); in APITest()
319 if (index->getCollator().getReorderCodes(reorderCodes, LENGTHOF(reorderCodes), status) > 0) { in APITest()
320 expectedLatinIndex = index->getBucketCount(status) - 1; in APITest()
322 n = index->getBucketIndex(adam, status); in APITest()
325 n = index->getBucketIndex(baker, status); in APITest()
327 n = index->getBucketIndex(Cyrillic, status); in APITest()
329 n = index->getBucketIndex(zed, status); in APITest()
332 delete index; in APITest()
358 AlphabeticIndex index(loc, status); in ManyLocalesTest() local
360 lc = index.getBucketCount(status); in ManyLocalesTest()
364 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in ManyLocalesTest()
368 assertEquals("initial bucket index", -1, index.getBucketIndex()); in ManyLocalesTest()
370 while (index.nextBucket(status)) { in ManyLocalesTest()
372 assertEquals("bucket index", bucketIndex, index.getBucketIndex()); in ManyLocalesTest()
373 const UnicodeString &label = index.getBucketLabel(); in ManyLocalesTest()
383 UAlphabeticIndexLabelType labelType = index.getBucketLabelType(); in ManyLocalesTest()
540 AlphabeticIndex index(locale, status); in TestIndexCharactersList() local
542 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestIndexCharactersList()
566 AlphabeticIndex index(coll.orphan(), status); in TestHaniFirst() local
568 assertEquals("getBucketCount()", 1, index.getBucketCount(status)); // ... (underflow only) in TestHaniFirst()
569 index.addLabels(Locale::getEnglish(), status); in TestHaniFirst()
570 assertEquals("getBucketCount()", 28, index.getBucketCount(status)); // ... A-Z ... in TestHaniFirst()
571 int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x897f), status); in TestHaniFirst()
573 bucketIndex = index.getBucketIndex("i", status); in TestHaniFirst()
575 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status); in TestHaniFirst()
578 bucketIndex = index.getBucketIndex(UnicodeString(0x50005), status); in TestHaniFirst()
580 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status); in TestHaniFirst()
595 AlphabeticIndex index(coll.orphan(), status); in TestPinyinFirst() local
597 assertEquals("getBucketCount()", 28, index.getBucketCount(status)); // ... A-Z ... in TestPinyinFirst()
598 index.addLabels(Locale::getChinese(), status); in TestPinyinFirst()
599 assertEquals("getBucketCount()", 28, index.getBucketCount(status)); // ... A-Z ... in TestPinyinFirst()
600 int32_t bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x897f), status); in TestPinyinFirst()
602 bucketIndex = index.getBucketIndex("i", status); in TestPinyinFirst()
604 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0x03B1), status); in TestPinyinFirst()
607 bucketIndex = index.getBucketIndex(UnicodeString(0x50005), status); in TestPinyinFirst()
609 bucketIndex = index.getBucketIndex(UnicodeString((UChar)0xFFFF), status); in TestPinyinFirst()
615 AlphabeticIndex index(Locale::getGerman(), status); in TestSchSt() local
616 index.addLabels(UnicodeSet("[\\u00C6{Sch*}{St*}]", status), status); in TestSchSt()
619 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestSchSt()
621 assertEquals("getBucketCount()", 31, index.getBucketCount(status)); in TestSchSt()
648 assertEquals(msg, testCase.bucketIndex, index.getBucketIndex(name, status)); in TestSchSt()
661 AlphabeticIndex index(coll.orphan(), status); in TestNoLabels() local
663 index.addRecord(UnicodeString((UChar)0x897f), NULL, status); in TestNoLabels()
664 index.addRecord("i", NULL, status); in TestNoLabels()
665 index.addRecord(UnicodeString((UChar)0x03B1), NULL, status); in TestNoLabels()
666 assertEquals("getBucketCount()", 1, index.getBucketCount(status)); // ... in TestNoLabels()
667 TEST_ASSERT(index.nextBucket(status)); in TestNoLabels()
668 … assertEquals("underflow label type", (int32_t)U_ALPHAINDEX_UNDERFLOW, index.getBucketLabelType()); in TestNoLabels()
669 assertEquals("all records in the underflow bucket", (int32_t)3, index.getBucketRecordCount()); in TestNoLabels()
676 AlphabeticIndex index(loc, status); in TestChineseZhuyin() local
677 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestChineseZhuyin()
689 AlphabeticIndex index(Locale::getJapanese(), status); in TestJapaneseKanji() local
690 LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status)); in TestJapaneseKanji()