• Home
  • Raw
  • Download

Lines Matching refs:trie

71     void checkFirst(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
72 void checkNext(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
73 void checkNextWithState(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
74 void checkNextWithState64(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
75 void checkNextString(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
76 void checkIterator(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
299 LocalPointer<UCharsTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST)); in TestNextForCodePoint() local
300 if(trie.isNull()) { in TestNextForCodePoint()
304 if( (result=trie->nextForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
305 (result=trie->nextForCodePoint(0x10000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
306 (result=trie->nextForCodePoint(0x9999))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
307 (result=trie->nextForCodePoint(0x20000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
308 (result=trie->nextForCodePoint(0xdfff))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
309 … (result=trie->nextForCodePoint(0x10ffff))!=USTRINGTRIE_FINAL_VALUE || result!=trie->current() || in TestNextForCodePoint()
310 trie->getValue()!=2000000000 in TestNextForCodePoint()
314 if( (result=trie->firstForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
315 (result=trie->nextForCodePoint(0x10000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
316 (result=trie->nextForCodePoint(0x9999))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
317 … (result=trie->nextForCodePoint(0x20002))!=USTRINGTRIE_FINAL_VALUE || result!=trie->current() || in TestNextForCodePoint()
318 trie->getValue()!=44444 in TestNextForCodePoint()
322 …if( (result=trie->reset().nextForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current… in TestNextForCodePoint()
323 (result=trie->nextForCodePoint(0x10000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
324 (result=trie->nextForCodePoint(0x9999))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
325 …(result=trie->nextForCodePoint(0x20222))!=USTRINGTRIE_NO_MATCH || result!=trie->current() // no m… in TestNextForCodePoint()
329 …if( (result=trie->reset().nextForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current… in TestNextForCodePoint()
330 … (result=trie->nextForCodePoint(0x103ff))!=USTRINGTRIE_FINAL_VALUE || result!=trie->current() || in TestNextForCodePoint()
331 trie->getValue()!=99999 in TestNextForCodePoint()
388 LocalPointer<UCharsTrie> trie(buildLargeTrie(1111)); in TestLargeTrie() local
389 if(trie.isNull()) { in TestLargeTrie()
397 if(trie->first(x[0])==USTRINGTRIE_NO_MATCH) { in TestLargeTrie()
404 UStringTrieResult result=trie->next(x.getBuffer(), x.length()); in TestLargeTrie()
405 if(!USTRINGTRIE_HAS_VALUE(result) || result!=trie->current() || value!=trie->getValue()) { in TestLargeTrie()
467 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_FAST)); in TestHasUniqueValue() local
468 if(trie.isNull()) { in TestHasUniqueValue()
472 if(trie->hasUniqueValue(uniqueValue)) { in TestHasUniqueValue()
475 trie->next(u_j); in TestHasUniqueValue()
476 trie->next(u_a); in TestHasUniqueValue()
477 trie->next(u_n); in TestHasUniqueValue()
479 if(!trie->hasUniqueValue(uniqueValue) || uniqueValue!=1) { in TestHasUniqueValue()
482 trie->first(u_j); in TestHasUniqueValue()
483 trie->next(u_u); in TestHasUniqueValue()
484 if(trie->hasUniqueValue(uniqueValue)) { in TestHasUniqueValue()
487 if(trie->next(u_n)!=USTRINGTRIE_INTERMEDIATE_VALUE || 6!=trie->getValue()) { in TestHasUniqueValue()
491 if(!trie->hasUniqueValue(uniqueValue) || uniqueValue!=6) { in TestHasUniqueValue()
495 trie->first(u_a); in TestHasUniqueValue()
496 trie->next(u_u); in TestHasUniqueValue()
497 if(!trie->hasUniqueValue(uniqueValue) || uniqueValue!=8) { in TestHasUniqueValue()
503 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_SMALL)); in TestGetNextUChars() local
504 if(trie.isNull()) { in TestGetNextUChars()
509 int32_t count=trie->getNextUChars(app); in TestGetNextUChars()
513 trie->next(u_j); in TestGetNextUChars()
514 trie->next(u_a); in TestGetNextUChars()
515 trie->next(u_n); in TestGetNextUChars()
518 count=trie->getNextUChars(app); in TestGetNextUChars()
523 trie->getValue(); // next() had returned USTRINGTRIE_INTERMEDIATE_VALUE. in TestGetNextUChars()
525 count=trie->getNextUChars(app); in TestGetNextUChars()
530 trie->next(u_u); in TestGetNextUChars()
532 count=trie->getNextUChars(app); in TestGetNextUChars()
536 trie->next(u_a); in TestGetNextUChars()
538 count=trie->getNextUChars(app); in TestGetNextUChars()
542 trie->next(u_r); in TestGetNextUChars()
543 trie->next(u_y); in TestGetNextUChars()
546 count=trie->getNextUChars(app); in TestGetNextUChars()
553 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_FAST)); in TestIteratorFromBranch() local
554 if(trie.isNull()) { in TestIteratorFromBranch()
558 trie->next(u_j); in TestIteratorFromBranch()
559 trie->next(u_a); in TestIteratorFromBranch()
560 trie->next(u_n); in TestIteratorFromBranch()
562 UCharsTrie::Iterator iter(*trie, 0, errorCode); in TestIteratorFromBranch()
602 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_SMALL)); in TestIteratorFromLinearMatch() local
603 if(trie.isNull()) { in TestIteratorFromLinearMatch()
607 trie->next(u_j); in TestIteratorFromLinearMatch()
608 trie->next(u_a); in TestIteratorFromLinearMatch()
609 trie->next(u_n); in TestIteratorFromLinearMatch()
610 trie->next(u_u); in TestIteratorFromLinearMatch()
611 trie->next(u_a); in TestIteratorFromLinearMatch()
613 UCharsTrie::Iterator iter(*trie, 0, errorCode); in TestIteratorFromLinearMatch()
630 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_FAST)); in TestTruncatingIteratorFromRoot() local
631 if(trie.isNull()) { in TestTruncatingIteratorFromRoot()
635 UCharsTrie::Iterator iter(*trie, 4, errorCode); in TestTruncatingIteratorFromRoot()
681 LocalPointer<UCharsTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST)); in TestTruncatingIteratorFromLinearMatchShort() local
682 if(trie.isNull()) { in TestTruncatingIteratorFromLinearMatchShort()
686 trie->next(u_a); in TestTruncatingIteratorFromLinearMatchShort()
687 trie->next(u_b); in TestTruncatingIteratorFromLinearMatchShort()
690 UCharsTrie::Iterator iter(*trie, 2, errorCode); in TestTruncatingIteratorFromLinearMatchShort()
709 LocalPointer<UCharsTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST)); in TestTruncatingIteratorFromLinearMatchLong() local
710 if(trie.isNull()) { in TestTruncatingIteratorFromLinearMatchLong()
714 trie->next(u_a); in TestTruncatingIteratorFromLinearMatchLong()
715 trie->next(u_b); in TestTruncatingIteratorFromLinearMatchLong()
716 trie->next(u_c); in TestTruncatingIteratorFromLinearMatchLong()
719 UCharsTrie::Iterator iter(*trie, 3, errorCode); in TestTruncatingIteratorFromLinearMatchLong()
759 LocalPointer<UCharsTrie> trie(buildTrie(data, dataLength, buildOption)); in checkData() local
760 if(trie.isNull()) { in checkData()
763 checkFirst(*trie, data, dataLength); in checkData()
764 checkNext(*trie, data, dataLength); in checkData()
765 checkNextWithState(*trie, data, dataLength); in checkData()
766 checkNextWithState64(*trie, data, dataLength); in checkData()
767 checkNextString(*trie, data, dataLength); in checkData()
768 checkIterator(*trie, data, dataLength); in checkData()
796 LocalPointer<UCharsTrie> trie(builder_->build(buildOption, errorCode)); in buildTrie() local
816 return trie.orphan(); in buildTrie()
822 void UCharsTrieTest::checkFirst(UCharsTrie &trie, in checkFirst() argument
831 UStringTrieResult firstResult=trie.first(c); in checkFirst()
832 int32_t firstValue=USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1; in checkFirst()
833 UStringTrieResult nextResult=trie.next(nextCp); in checkFirst()
834 if(firstResult!=trie.reset().next(c) || in checkFirst()
835 firstResult!=trie.current() || in checkFirst()
836 firstValue!=(USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1) || in checkFirst()
837 nextResult!=trie.next(nextCp) in checkFirst()
845 firstResult=trie.firstForCodePoint(c); in checkFirst()
846 firstValue=USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1; in checkFirst()
847 nextResult=trie.nextForCodePoint(nextCp); in checkFirst()
848 if(firstResult!=trie.reset().nextForCodePoint(c) || in checkFirst()
849 firstResult!=trie.current() || in checkFirst()
850 firstValue!=(USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1) || in checkFirst()
851 nextResult!=trie.nextForCodePoint(nextCp) in checkFirst()
857 trie.reset(); in checkFirst()
860 void UCharsTrieTest::checkNext(UCharsTrie &trie, in checkNext() argument
868 result=trie.next(expectedString.getTerminatedBuffer(), stringLength)) || in checkNext()
869 result!=trie.current() in checkNext()
872 } else if(trie.getValue()!=data[i].value) { in checkNext()
875 (long)trie.getValue(), (long)trie.getValue(), in checkNext()
877 } else if(result!=trie.current() || trie.getValue()!=data[i].value) { in checkNext()
880 trie.reset(); in checkNext()
882 result=trie.current(); in checkNext()
889 trie.getValue(); in checkNext()
890 if(trie.current()!=USTRINGTRIE_INTERMEDIATE_VALUE) { in checkNext()
895 result=trie.next(expectedString[j]); in checkNext()
900 if(result!=trie.current()) { in checkNext()
909 trie.getValue(); in checkNext()
910 if(result!=trie.current()) { in checkNext()
915 trie.saveState(state); in checkNext()
921 if(trie.resetToState(state).next(c)) { in checkNext()
930 trie.reset(); in checkNext()
934 void UCharsTrieTest::checkNextWithState(UCharsTrie &trie, in checkNextWithState() argument
940 trie.resetToState(noState); in checkNextWithState()
946 if(!USTRINGTRIE_MATCHES(trie.next(expectedString[j]))) { in checkNextWithState()
951 trie.saveState(state); in checkNextWithState()
952 UStringTrieResult resultAtState=trie.current(); in checkNextWithState()
956 valueAtState=trie.getValue(); in checkNextWithState()
958 result=trie.next(0); // mismatch in checkNextWithState()
959 if(result!=USTRINGTRIE_NO_MATCH || result!=trie.current()) { in checkNextWithState()
962 if( resultAtState!=trie.resetToState(state).current() || in checkNextWithState()
963 (USTRINGTRIE_HAS_VALUE(resultAtState) && valueAtState!=trie.getValue()) in checkNextWithState()
969 result=trie.next(expectedString.getTerminatedBuffer()+partialLength, in checkNextWithState()
971 result!=trie.current()) { in checkNextWithState()
976 result=trie.resetToState(state). in checkNextWithState()
979 result!=trie.current()) { in checkNextWithState()
982 } else if(trie.getValue()!=data[i].value) { in checkNextWithState()
985 (long)trie.getValue(), (long)trie.getValue(), in checkNextWithState()
988 trie.reset(); in checkNextWithState()
992 void UCharsTrieTest::checkNextWithState64(UCharsTrie &trie, in checkNextWithState64() argument
994 assertTrue("trie(initial state).getState64()!=0", trie.getState64() != 0); in checkNextWithState64()
1000 if(!USTRINGTRIE_MATCHES(trie.next(expectedString[j]))) { in checkNextWithState64()
1005 uint64_t state = trie.getState64(); in checkNextWithState64()
1007 UStringTrieResult resultAtState=trie.current(); in checkNextWithState64()
1011 valueAtState=trie.getValue(); in checkNextWithState64()
1013 result=trie.next(0); // mismatch in checkNextWithState64()
1014 if(result!=USTRINGTRIE_NO_MATCH || result!=trie.current()) { in checkNextWithState64()
1017 if( resultAtState!=trie.resetToState64(state).current() || in checkNextWithState64()
1018 (USTRINGTRIE_HAS_VALUE(resultAtState) && valueAtState!=trie.getValue()) in checkNextWithState64()
1024 result=trie.next(expectedString.getTerminatedBuffer()+partialLength, in checkNextWithState64()
1026 result!=trie.current()) { in checkNextWithState64()
1031 result=trie.resetToState64(state). in checkNextWithState64()
1034 result!=trie.current()) { in checkNextWithState64()
1037 } else if(trie.getValue()!=data[i].value) { in checkNextWithState64()
1040 (long)trie.getValue(), (long)trie.getValue(), in checkNextWithState64()
1043 trie.reset(); in checkNextWithState64()
1049 void UCharsTrieTest::checkNextString(UCharsTrie &trie, in checkNextString() argument
1054 if(!trie.next(expectedString.getTerminatedBuffer(), stringLength/2)) { in checkNextString()
1059 if(trie.next(expectedString.getTerminatedBuffer()+stringLength/2, in checkNextString()
1063 trie.reset(); in checkNextString()
1067 void UCharsTrieTest::checkIterator(UCharsTrie &trie, in checkIterator() argument
1070 UCharsTrie::Iterator iter(trie, 0, errorCode); in checkIterator()