Lines Matching full:data
65 void checkData(const StringAndValue data[], int32_t dataLength);
66 void checkData(const StringAndValue data[], int32_t dataLength, UStringTrieBuildOption buildOption);
67 UCharsTrie *buildTrie(const StringAndValue data[], int32_t dataLength,
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);
74 void checkIterator(UCharsTrie::Iterator &iter, const StringAndValue data[], int32_t dataLength);
138 static const StringAndValue data[]={
141 checkData(data, LENGTHOF(data));
145 static const StringAndValue data[]={
148 checkData(data, LENGTHOF(data));
152 static const StringAndValue data[]={
156 checkData(data, LENGTHOF(data));
160 static const StringAndValue data[]={
164 checkData(data, LENGTHOF(data));
168 static const StringAndValue data[]={
184 for(int32_t length=2; length<=LENGTHOF(data); ++length) {
186 checkData(data, length);
191 static const StringAndValue data[]={
203 checkData(data, LENGTHOF(data));
208 static const StringAndValue data[]={
231 checkData(data, LENGTHOF(data));
237 static const StringAndValue data[]={
245 checkData(data, LENGTHOF(data));
250 static const StringAndValue data[]={
272 checkData(data, LENGTHOF(data));
276 static const StringAndValue data[]={
287 checkData(data, LENGTHOF(data));
291 static const StringAndValue data[]={
296 LocalPointer<UCharsTrie> trie(buildTrie(data, LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
309 errln("UCharsTrie.nextForCodePoint() fails for %s", data[0].s);
317 errln("UCharsTrie.nextForCodePoint() fails for %s", data[1].s);
330 errln("UCharsTrie.nextForCodePoint() fails for %s", data[2].s);
428 static const StringAndValue data[]={
460 return buildTrie(data, LENGTHOF(data), buildOption);
563 // Expected data: Same as in buildMonthsTrie(), except only the suffixes
565 static const StringAndValue data[]={
592 checkIterator(iter, data, LENGTHOF(data));
595 checkIterator(iter.reset(), data, LENGTHOF(data));
614 // Expected data: Same as in buildMonthsTrie(), except only the suffixes
616 static const StringAndValue data[]={
620 checkIterator(iter, data, LENGTHOF(data));
623 checkIterator(iter.reset(), data, LENGTHOF(data));
636 // Expected data: Same as in buildMonthsTrie(), except only the first 4 characters
638 static const StringAndValue data[]={
666 checkIterator(iter, data, LENGTHOF(data));
669 checkIterator(iter.reset(), data, LENGTHOF(data));
673 static const StringAndValue data[]={
678 LocalPointer<UCharsTrie> trie(buildTrie(data, LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
701 static const StringAndValue data[]={
706 LocalPointer<UCharsTrie> trie(buildTrie(data, LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
732 static const StringAndValue data[]={
739 for(int32_t i=0; i<LENGTHOF(data); ++i) {
740 builder_->add(data[i].s, data[i].value, errorCode);
745 checkIterator(iter, data, LENGTHOF(data));
748 void UCharsTrieTest::checkData(const StringAndValue data[], int32_t dataLength) {
750 checkData(data, dataLength, USTRINGTRIE_BUILD_FAST);
752 checkData(data, dataLength, USTRINGTRIE_BUILD_SMALL);
755 void UCharsTrieTest::checkData(const StringAndValue data[], int32_t dataLength, UStringTrieBuildOption buildOption) {
756 LocalPointer<UCharsTrie> trie(buildTrie(data, dataLength, buildOption));
760 checkFirst(*trie, data, dataLength);
761 checkNext(*trie, data, dataLength);
762 checkNextWithState(*trie, data, dataLength);
763 checkNextString(*trie, data, dataLength);
764 checkIterator(*trie, data, dataLength);
767 UCharsTrie *UCharsTrieTest::buildTrie(const StringAndValue data[], int32_t dataLength,
786 builder_->add(UnicodeString(data[index].s, -1, US_INV).unescape(),
787 data[index].value, errorCode);
819 const StringAndValue data[], int32_t dataLength) {
821 if(*data[i].s==0) {
824 UnicodeString expectedString=UnicodeString(data[i].s, -1, US_INV).unescape();
836 c, data[i].s);
850 c, data[i].s);
857 const StringAndValue data[], int32_t dataLength) {
860 UnicodeString expectedString=UnicodeString(data[i].s, -1, US_INV).unescape();
867 errln("trie does not seem to contain %s", data[i].s);
868 } else if(trie.getValue()!=data[i].value) {
870 data[i].s,
872 (long)data[i].value, (long)data[i].value);
873 } else if(result!=trie.current() || trie.getValue()!=data[i].value) {
874 errln("trie value for %s changes when repeating current()/getValue()", data[i].s);
881 errln("trie.current()!=hasNext before end of %s (at index %d)", data[i].s, j);
887 errln("trie.getValue().current()!=USTRINGTRIE_INTERMEDIATE_VALUE before end of %s (at index %d)", data[i].s, j);
893 errln("trie.next()=USTRINGTRIE_NO_MATCH before end of %s (at index %d)", data[i].s, j);
897 errln("trie.next()!=following current() before end of %s (at index %d)", data[i].s, j);
902 errln("trie.next()!=hasValue at the end of %s", data[i].s);
908 data[i].s);
924 "(trie.next(some UChar)!=USTRINGTRIE_NO_MATCH) after end of %s", data[i].s);
931 const StringAndValue data[], int32_t dataLength) {
938 UnicodeString expectedString=UnicodeString(data[i].s, -1, US_INV).unescape();
943 errln("trie.next()=USTRINGTRIE_NO_MATCH for a prefix of %s", data[i].s);
956 errln("trie.next(0) matched after part of %s", data[i].s);
963 data[i].s);
970 data[i].s, data[i].s);
977 data[i].s);
978 } else if(trie.getValue()!=data[i].value) {
980 data[i].s,
982 (long)data[i].value, (long)data[i].value);
991 const StringAndValue data[], int32_t dataLength) {
993 UnicodeString expectedString=UnicodeString(data[i].s, -1, US_INV).unescape();
996 errln("trie.next(up to middle of string)=USTRINGTRIE_NO_MATCH for %s", data[i].s);
1002 errln("trie.next(string+NUL)!=USTRINGTRIE_NO_MATCH for %s", data[i].s);
1009 const StringAndValue data[], int32_t dataLength) {
1015 checkIterator(iter, data, dataLength);
1019 const StringAndValue data[], int32_t dataLength) {
1023 errln("trie iterator hasNext()=FALSE for item %d: %s", (int)i, data[i].s);
1027 if(errorCode.logIfFailureAndReset("trie iterator next() for item %d: %s", (int)i, data[i].s)) {
1031 errln("trie iterator next()=FALSE for item %d: %s", (int)i, data[i].s);
1034 UnicodeString expectedString=UnicodeString(data[i].s, -1, US_INV).unescape();
1040 buffer, data[i].s, (int)i);
1042 if(iter.getValue()!=data[i].value) {
1045 (long)data[i].value, (long)data[i].value,
1046 (int)i, data[i].s);