• Home
  • Raw
  • Download

Lines Matching refs:trie

69     void checkFirst(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
70 void checkNext(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
71 void checkNextWithState(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
72 void checkNextString(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
73 void checkIterator(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
296 LocalPointer<UCharsTrie> trie(buildTrie(data, LENGTHOF(data), USTRINGTRIE_BUILD_FAST)); in TestNextForCodePoint() local
297 if(trie.isNull()) { in TestNextForCodePoint()
301 if( (result=trie->nextForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
302 (result=trie->nextForCodePoint(0x10000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
303 (result=trie->nextForCodePoint(0x9999))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
304 (result=trie->nextForCodePoint(0x20000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
305 (result=trie->nextForCodePoint(0xdfff))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
306 … (result=trie->nextForCodePoint(0x10ffff))!=USTRINGTRIE_FINAL_VALUE || result!=trie->current() || in TestNextForCodePoint()
307 trie->getValue()!=2000000000 in TestNextForCodePoint()
311 if( (result=trie->firstForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
312 (result=trie->nextForCodePoint(0x10000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
313 (result=trie->nextForCodePoint(0x9999))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
314 … (result=trie->nextForCodePoint(0x20002))!=USTRINGTRIE_FINAL_VALUE || result!=trie->current() || in TestNextForCodePoint()
315 trie->getValue()!=44444 in TestNextForCodePoint()
319 …if( (result=trie->reset().nextForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current… in TestNextForCodePoint()
320 (result=trie->nextForCodePoint(0x10000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
321 (result=trie->nextForCodePoint(0x9999))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
322 …(result=trie->nextForCodePoint(0x20222))!=USTRINGTRIE_NO_MATCH || result!=trie->current() // no m… in TestNextForCodePoint()
326 …if( (result=trie->reset().nextForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current… in TestNextForCodePoint()
327 … (result=trie->nextForCodePoint(0x103ff))!=USTRINGTRIE_FINAL_VALUE || result!=trie->current() || in TestNextForCodePoint()
328 trie->getValue()!=99999 in TestNextForCodePoint()
385 LocalPointer<UCharsTrie> trie(buildLargeTrie(1111)); in TestLargeTrie() local
386 if(trie.isNull()) { in TestLargeTrie()
394 if(trie->first(x[0])==USTRINGTRIE_NO_MATCH) { in TestLargeTrie()
401 UStringTrieResult result=trie->next(x.getBuffer(), x.length()); in TestLargeTrie()
402 if(!USTRINGTRIE_HAS_VALUE(result) || result!=trie->current() || value!=trie->getValue()) { in TestLargeTrie()
464 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_FAST)); in TestHasUniqueValue() local
465 if(trie.isNull()) { in TestHasUniqueValue()
469 if(trie->hasUniqueValue(uniqueValue)) { in TestHasUniqueValue()
472 trie->next(u_j); in TestHasUniqueValue()
473 trie->next(u_a); in TestHasUniqueValue()
474 trie->next(u_n); in TestHasUniqueValue()
476 if(!trie->hasUniqueValue(uniqueValue) || uniqueValue!=1) { in TestHasUniqueValue()
479 trie->first(u_j); in TestHasUniqueValue()
480 trie->next(u_u); in TestHasUniqueValue()
481 if(trie->hasUniqueValue(uniqueValue)) { in TestHasUniqueValue()
484 if(trie->next(u_n)!=USTRINGTRIE_INTERMEDIATE_VALUE || 6!=trie->getValue()) { in TestHasUniqueValue()
488 if(!trie->hasUniqueValue(uniqueValue) || uniqueValue!=6) { in TestHasUniqueValue()
492 trie->first(u_a); in TestHasUniqueValue()
493 trie->next(u_u); in TestHasUniqueValue()
494 if(!trie->hasUniqueValue(uniqueValue) || uniqueValue!=8) { in TestHasUniqueValue()
500 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_SMALL)); in TestGetNextUChars() local
501 if(trie.isNull()) { in TestGetNextUChars()
506 int32_t count=trie->getNextUChars(app); in TestGetNextUChars()
510 trie->next(u_j); in TestGetNextUChars()
511 trie->next(u_a); in TestGetNextUChars()
512 trie->next(u_n); in TestGetNextUChars()
515 count=trie->getNextUChars(app); in TestGetNextUChars()
520 trie->getValue(); // next() had returned USTRINGTRIE_INTERMEDIATE_VALUE. in TestGetNextUChars()
522 count=trie->getNextUChars(app); in TestGetNextUChars()
527 trie->next(u_u); in TestGetNextUChars()
529 count=trie->getNextUChars(app); in TestGetNextUChars()
533 trie->next(u_a); in TestGetNextUChars()
535 count=trie->getNextUChars(app); in TestGetNextUChars()
539 trie->next(u_r); in TestGetNextUChars()
540 trie->next(u_y); in TestGetNextUChars()
543 count=trie->getNextUChars(app); in TestGetNextUChars()
550 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_FAST)); in TestIteratorFromBranch() local
551 if(trie.isNull()) { in TestIteratorFromBranch()
555 trie->next(u_j); in TestIteratorFromBranch()
556 trie->next(u_a); in TestIteratorFromBranch()
557 trie->next(u_n); in TestIteratorFromBranch()
559 UCharsTrie::Iterator iter(*trie, 0, errorCode); in TestIteratorFromBranch()
599 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_SMALL)); in TestIteratorFromLinearMatch() local
600 if(trie.isNull()) { in TestIteratorFromLinearMatch()
604 trie->next(u_j); in TestIteratorFromLinearMatch()
605 trie->next(u_a); in TestIteratorFromLinearMatch()
606 trie->next(u_n); in TestIteratorFromLinearMatch()
607 trie->next(u_u); in TestIteratorFromLinearMatch()
608 trie->next(u_a); in TestIteratorFromLinearMatch()
610 UCharsTrie::Iterator iter(*trie, 0, errorCode); in TestIteratorFromLinearMatch()
627 LocalPointer<UCharsTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_FAST)); in TestTruncatingIteratorFromRoot() local
628 if(trie.isNull()) { in TestTruncatingIteratorFromRoot()
632 UCharsTrie::Iterator iter(*trie, 4, errorCode); in TestTruncatingIteratorFromRoot()
678 LocalPointer<UCharsTrie> trie(buildTrie(data, LENGTHOF(data), USTRINGTRIE_BUILD_FAST)); in TestTruncatingIteratorFromLinearMatchShort() local
679 if(trie.isNull()) { in TestTruncatingIteratorFromLinearMatchShort()
683 trie->next(u_a); in TestTruncatingIteratorFromLinearMatchShort()
684 trie->next(u_b); in TestTruncatingIteratorFromLinearMatchShort()
687 UCharsTrie::Iterator iter(*trie, 2, errorCode); in TestTruncatingIteratorFromLinearMatchShort()
706 LocalPointer<UCharsTrie> trie(buildTrie(data, LENGTHOF(data), USTRINGTRIE_BUILD_FAST)); in TestTruncatingIteratorFromLinearMatchLong() local
707 if(trie.isNull()) { in TestTruncatingIteratorFromLinearMatchLong()
711 trie->next(u_a); in TestTruncatingIteratorFromLinearMatchLong()
712 trie->next(u_b); in TestTruncatingIteratorFromLinearMatchLong()
713 trie->next(u_c); in TestTruncatingIteratorFromLinearMatchLong()
716 UCharsTrie::Iterator iter(*trie, 3, errorCode); in TestTruncatingIteratorFromLinearMatchLong()
756 LocalPointer<UCharsTrie> trie(buildTrie(data, dataLength, buildOption)); in checkData() local
757 if(trie.isNull()) { in checkData()
760 checkFirst(*trie, data, dataLength); in checkData()
761 checkNext(*trie, data, dataLength); in checkData()
762 checkNextWithState(*trie, data, dataLength); in checkData()
763 checkNextString(*trie, data, dataLength); in checkData()
764 checkIterator(*trie, data, dataLength); in checkData()
792 LocalPointer<UCharsTrie> trie(builder_->build(buildOption, errorCode)); in buildTrie() local
812 return trie.orphan(); in buildTrie()
818 void UCharsTrieTest::checkFirst(UCharsTrie &trie, in checkFirst() argument
827 UStringTrieResult firstResult=trie.first(c); in checkFirst()
828 int32_t firstValue=USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1; in checkFirst()
829 UStringTrieResult nextResult=trie.next(nextCp); in checkFirst()
830 if(firstResult!=trie.reset().next(c) || in checkFirst()
831 firstResult!=trie.current() || in checkFirst()
832 firstValue!=(USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1) || in checkFirst()
833 nextResult!=trie.next(nextCp) in checkFirst()
841 firstResult=trie.firstForCodePoint(c); in checkFirst()
842 firstValue=USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1; in checkFirst()
843 nextResult=trie.nextForCodePoint(nextCp); in checkFirst()
844 if(firstResult!=trie.reset().nextForCodePoint(c) || in checkFirst()
845 firstResult!=trie.current() || in checkFirst()
846 firstValue!=(USTRINGTRIE_HAS_VALUE(firstResult) ? trie.getValue() : -1) || in checkFirst()
847 nextResult!=trie.nextForCodePoint(nextCp) in checkFirst()
853 trie.reset(); in checkFirst()
856 void UCharsTrieTest::checkNext(UCharsTrie &trie, in checkNext() argument
864 result=trie.next(expectedString.getTerminatedBuffer(), stringLength)) || in checkNext()
865 result!=trie.current() in checkNext()
868 } else if(trie.getValue()!=data[i].value) { in checkNext()
871 (long)trie.getValue(), (long)trie.getValue(), in checkNext()
873 } else if(result!=trie.current() || trie.getValue()!=data[i].value) { in checkNext()
876 trie.reset(); in checkNext()
878 result=trie.current(); in checkNext()
885 trie.getValue(); in checkNext()
886 if(trie.current()!=USTRINGTRIE_INTERMEDIATE_VALUE) { in checkNext()
891 result=trie.next(expectedString[j]); in checkNext()
896 if(result!=trie.current()) { in checkNext()
905 trie.getValue(); in checkNext()
906 if(result!=trie.current()) { in checkNext()
911 trie.saveState(state); in checkNext()
917 if(trie.resetToState(state).next(c)) { in checkNext()
926 trie.reset(); in checkNext()
930 void UCharsTrieTest::checkNextWithState(UCharsTrie &trie, in checkNextWithState() argument
936 trie.resetToState(noState); in checkNextWithState()
942 if(!USTRINGTRIE_MATCHES(trie.next(expectedString[j]))) { in checkNextWithState()
947 trie.saveState(state); in checkNextWithState()
948 UStringTrieResult resultAtState=trie.current(); in checkNextWithState()
952 valueAtState=trie.getValue(); in checkNextWithState()
954 result=trie.next(0); // mismatch in checkNextWithState()
955 if(result!=USTRINGTRIE_NO_MATCH || result!=trie.current()) { in checkNextWithState()
958 if( resultAtState!=trie.resetToState(state).current() || in checkNextWithState()
959 (USTRINGTRIE_HAS_VALUE(resultAtState) && valueAtState!=trie.getValue()) in checkNextWithState()
965 result=trie.next(expectedString.getTerminatedBuffer()+partialLength, in checkNextWithState()
967 result!=trie.current()) { in checkNextWithState()
972 result=trie.resetToState(state). in checkNextWithState()
975 result!=trie.current()) { in checkNextWithState()
978 } else if(trie.getValue()!=data[i].value) { in checkNextWithState()
981 (long)trie.getValue(), (long)trie.getValue(), in checkNextWithState()
984 trie.reset(); in checkNextWithState()
990 void UCharsTrieTest::checkNextString(UCharsTrie &trie, in checkNextString() argument
995 if(!trie.next(expectedString.getTerminatedBuffer(), stringLength/2)) { in checkNextString()
1000 if(trie.next(expectedString.getTerminatedBuffer()+stringLength/2, in checkNextString()
1004 trie.reset(); in checkNextString()
1008 void UCharsTrieTest::checkIterator(UCharsTrie &trie, in checkIterator() argument
1011 UCharsTrie::Iterator iter(trie, 0, errorCode); in checkIterator()