Home | History | Annotate | Download | only in cintltst

Lines Matching defs:trie

98              const UTrie2 *trie,
105 utrie2_enum(trie, testEnumValue, testEnumRange, &checkRanges);
111 const UTrie2 *trie, UTrie2ValueBits valueBits,
118 UBool isFrozen=utrie2_isFrozen(trie);
119 const char *const typeName= isFrozen ? "frozen trie" : "newTrie";
133 value2=UTRIE2_GET16_FROM_U16_SINGLE_LEAD(trie, start);
135 value2=UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, start);
144 value2=UTRIE2_GET16_FROM_SUPP(trie, start);
146 value2=UTRIE2_GET32_FROM_SUPP(trie, start);
154 value2=UTRIE2_GET16(trie, start);
156 value2=UTRIE2_GET32(trie, start);
163 value2=utrie2_get32(trie, start);
181 value2=trie->data16[start];
183 value2=trie->data32[start];
194 value2=trie->data16[start];
196 value2=trie->data32[start];
229 value2=UTRIE2_GET16_FROM_U16_SINGLE_LEAD(trie, start);
231 value2=UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, start);
238 value2=utrie2_get32FromLeadSurrogateCodeUnit(trie, start);
249 value=UTRIE2_GET16(trie, -1);
250 value2=UTRIE2_GET16(trie, 0x110000);
252 value=UTRIE2_GET32(trie, -1);
253 value2=UTRIE2_GET32(trie, 0x110000);
260 value=utrie2_get32(trie, -1);
261 value2=utrie2_get32(trie, 0x110000);
270 const UTrie2 *trie, UTrie2ValueBits valueBits,
308 UTRIE2_U16_NEXT16(trie, p, limit, c, value);
310 UTRIE2_U16_NEXT32(trie, p, limit, c, value);
333 UTRIE2_U16_PREV16(trie, s, p, c, value);
335 UTRIE2_U16_PREV32(trie, s, p, c, value);
350 const UTrie2 *trie, UTrie2ValueBits valueBits,
431 UTRIE2_U8_NEXT16(trie, p, limit, value);
433 UTRIE2_U8_NEXT32(trie, p, limit, value);
461 UTRIE2_U8_PREV16(trie, s, p, value);
463 UTRIE2_U8_PREV32(trie, s, p, value);
486 UTrie2 *trie, UTrie2ValueBits valueBits,
491 if(!utrie2_isFrozen(trie)) {
497 testTrieGetters(testName, trie, valueBits, checkRanges, countCheckRanges);
498 testTrieEnum(testName, trie, checkRanges, countCheckRanges);
499 testTrieUTF16(testName, trie, valueBits, checkRanges, countCheckRanges);
500 testTrieUTF8(testName, trie, valueBits, checkRanges, countCheckRanges);
503 value=utrie2_get32(trie, 1);
504 utrie2_set32(trie, 1, 234, &errorCode);
505 value2=utrie2_get32(trie, 1);
513 utrie2_setRange32(trie, 1, 5, 234, TRUE, &errorCode);
514 value2=utrie2_get32(trie, 1);
522 value=utrie2_get32FromLeadSurrogateCodeUnit(trie, 0xd801);
523 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd801, 234, &errorCode);
524 value2=utrie2_get32FromLeadSurrogateCodeUnit(trie, 0xd801);
534 testNewTrie(const char *testName, const UTrie2 *trie,
536 /* The valueBits are ignored for an unfrozen trie. */
537 testTrieGetters(testName, trie, UTRIE2_COUNT_VALUE_BITS, checkRanges, countCheckRanges);
538 testTrieEnum(testName, trie, checkRanges, countCheckRanges);
543 UTrie2 *trie, UTrie2ValueBits valueBits,
551 /* clone the trie so that the caller can reuse the original */
553 trie=utrie2_clone(trie, &errorCode);
566 utrie2_serialize(trie, storage, sizeof(storage), &errorCode);
573 utrie2_freeze(trie, valueBits, &errorCode);
574 if(U_FAILURE(errorCode) || !utrie2_isFrozen(trie)) {
576 testName, u_errorName(errorCode), utrie2_isFrozen(trie));
580 utrie2_freeze(trie, otherValueBits, &errorCode);
589 /* clone a frozen trie */
590 UTrie2 *clone=utrie2_clone(trie, &errorCode);
596 utrie2_close(trie);
597 trie=clone;
600 length1=utrie2_serialize(trie, NULL, 0, &errorCode);
607 length2=utrie2_serialize(trie, storage, sizeof(storage), &errorCode);
617 log_err("error: trie serialization (%s) lengths different: "
622 testFrozenTrie(testName, trie, valueBits, checkRanges, countCheckRanges);
623 utrie2_close(trie);
624 trie=NULL;
673 trie=utrie2_openFromSerialized(valueBits, storage, length2, &length3, &errorCode);
678 if((valueBits==UTRIE2_16_VALUE_BITS)!=(trie->data32==NULL)) {
679 log_err("error: trie serialization (%s) did not preserve 32-bitness\n", testName);
683 log_err("error: trie serialization (%s) lengths different: "
690 utrie2_freeze(trie, valueBits, &errorCode);
691 if(U_FAILURE(errorCode) || !utrie2_isFrozen(trie)) {
693 testName, u_errorName(errorCode), utrie2_isFrozen(trie));
696 utrie2_freeze(trie, otherValueBits, &errorCode);
705 /* clone an unserialized trie */
706 UTrie2 *clone=utrie2_clone(trie, &errorCode);
711 /* no need to break: just test the original trie */
713 utrie2_close(trie);
714 trie=clone;
718 testFrozenTrie(testName, trie, valueBits, checkRanges, countCheckRanges);
720 /* clone-as-thawed an unserialized trie */
721 UTrie2 *clone=utrie2_cloneAsThawed(trie, &errorCode);
725 testName, u_errorName(errorCode), clone!=NULL && utrie2_isFrozen(trie));
728 utrie2_close(trie);
729 trie=clone;
735 value=utrie2_get32(trie, 0xa1);
736 utrie2_set32(trie, 0xa1, 789, &errorCode);
737 value2=utrie2_get32(trie, 0xa1);
738 utrie2_set32(trie, 0xa1, value, &errorCode);
744 testNewTrie(testName, trie, checkRanges, countCheckRanges);
747 utrie2_close(trie);
752 UTrie2 *trie, UBool withClone,
756 /* verify that all the expected values are in the unfrozen trie */
757 testNewTrie(testName, trie, checkRanges, countCheckRanges);
765 testTrieSerialize(name, trie,
772 * clone-as-thawed just to sometimes try it on an unfrozen trie
775 UTrie2 *clone=utrie2_cloneAsThawed(trie, &errorCode);
780 utrie2_close(trie);
781 trie=clone;
783 testNewTrie(testName, trie, checkRanges, countCheckRanges);
789 testTrieSerialize(name, trie,
793 return trie; /* could be the clone */
800 UTrie2 *trie;
808 log_verbose("\ntesting Trie '%s'\n", testName);
811 trie=utrie2_open(initialValue, errorValue, &errorCode);
821 UTrie2 *clone=utrie2_clone(trie, &errorCode);
827 utrie2_close(trie);
828 trie=clone;
836 utrie2_set32(trie, start, value, &errorCode);
838 utrie2_setRange32(trie, start, limit-1, value, overwrite, &errorCode);
843 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd800, 90, &errorCode);
844 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd999, 94, &errorCode);
845 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xdbff, 99, &errorCode);
847 return trie;
849 log_err("error: setting values into a trie (%s) failed - %s\n",
851 utrie2_close(trie);
860 UTrie2 *trie=makeTrieWithRanges(testName, withClone,
863 if(trie!=NULL) {
864 trie=testTrieSerializeAllValueBits(testName, trie, withClone,
866 utrie2_close(trie);
1060 UTrie2 *trie=makeTrieWithRanges(testName, FALSE,
1063 while(trie!=NULL) {
1067 utrie2_enumForLeadSurrogate(trie, 0xd800,
1071 utrie2_enumForLeadSurrogate(trie, 0xd87e,
1075 utrie2_enumForLeadSurrogate(trie, 0xd87f,
1079 utrie2_enumForLeadSurrogate(trie, 0xdbff,
1082 if(!utrie2_isFrozen(trie)) {
1084 utrie2_freeze(trie, UTRIE2_16_VALUE_BITS, &errorCode);
1087 utrie2_close(trie);
1091 utrie2_close(trie);
1108 UTrie2 *trie;
1127 trie=utrie2_openDummy(valueBits, initialValue, errorValue, &errorCode);
1133 testFrozenTrie(testName, trie, valueBits, checkRanges, LENGTHOF(checkRanges));
1134 utrie2_close(trie);
1157 UTrie2 *trie;
1162 trie=utrie2_open(1, 0xbad, &errorCode);
1173 utrie2_setRange32(trie, 0x740, 0x840-1, 1, TRUE, &errorCode);
1174 utrie2_setRange32(trie, 0x780, 0x880-1, 1, TRUE, &errorCode);
1175 utrie2_setRange32(trie, 0x740, 0x840-1, 2, TRUE, &errorCode);
1176 utrie2_setRange32(trie, 0x780, 0x880-1, 3, TRUE, &errorCode);
1179 utrie2_setRange32(trie, 0x1000, 0x3000-1, 2, TRUE, &errorCode);
1180 utrie2_setRange32(trie, 0x2000, 0x4000-1, 3, TRUE, &errorCode);
1181 utrie2_setRange32(trie, 0x1000, 0x4000-1, 1, TRUE, &errorCode);
1183 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd800, 90, &errorCode);
1184 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd999, 94, &errorCode);
1185 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xdbff, 99, &errorCode);
1187 log_err("error: setting lots of ranges into a trie (%s) failed - %s\n",
1189 utrie2_close(trie);
1193 trie=testTrieSerializeAllValueBits(testName, trie, FALSE,
1195 utrie2_close(trie);
1210 UTrie2 *trie;
1215 trie=utrie2_open(1, 0xbad, &errorCode);
1226 utrie2_set32(trie, i, 2, &errorCode);
1229 utrie2_set32(trie, i, 3, &errorCode);
1232 utrie2_set32(trie, i, 4, &errorCode);
1235 utrie2_set32(trie, i, 5, &errorCode);
1238 utrie2_set32ForLeadSurrogateCodeUnit(trie, i, 1, &errorCode);
1241 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd800, 90, &errorCode);
1242 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd999, 94, &errorCode);
1243 utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xdbff, 99, &errorCode);
1245 log_err("error: setting lots of values into a trie (%s) failed - %s\n",
1247 utrie2_close(trie);
1251 trie=testTrieSerializeAllValueBits(testName, trie, FALSE,
1253 utrie2_close(trie);
1295 log_verbose("\ntesting Trie '%s'\n", testName);