Lines Matching full:trie
55 _testFoldedValue32(UNewTrie *trie, UChar32 start, int32_t offset) {
64 value=utrie_get32(trie, start, &inBlockZero);
86 _testFoldedValue16(UNewTrie *trie, UChar32 start, int32_t offset) {
95 value=utrie_get32(trie, start, &inBlockZero);
141 const UTrie *trie,
170 if(trie->data32!=NULL) {
171 UTRIE_NEXT32(trie, p, limit, c, c2, value);
173 UTRIE_NEXT16(trie, p, limit, c, c2, value);
191 if(trie->data32==NULL) {
192 value=UTRIE_GET16_FROM_LEAD(trie, c);
193 offset=trie->getFoldingOffset(value);
195 value=UTRIE_GET16_FROM_OFFSET_TRAIL(trie, offset, c2);
197 value=trie->initialValue;
200 value=UTRIE_GET32_FROM_LEAD(trie, c);
201 offset=trie->getFoldingOffset(value);
203 value=UTRIE_GET32_FROM_OFFSET_TRAIL(trie, offset, c2);
205 value=trie->initialValue;
215 if(trie->data32==NULL) {
216 UTRIE_GET16_FROM_PAIR(trie, c, c2, value);
218 UTRIE_GET32_FROM_PAIR(trie, c, c2, value);
234 if(trie->data32!=NULL) {
235 UTRIE_PREVIOUS32(trie, s, p, c, c2, value);
237 UTRIE_PREVIOUS16(trie, s, p, c, c2, value);
262 UTrie trie={ 0 };
272 log_verbose("\ntesting Trie '%s'\n", testName);
291 log_err("error: setting values into a trie failed (%s)\n", testName);
295 /* verify that all these values are in the new Trie */
351 if(!utrie_unserialize(&trie, storage, length, &errorCode)) {
355 trie.getFoldingOffset=getFoldingOffset;
357 if(dataIs32!=(trie.data32!=NULL)) {
358 log_err("error: trie serialization (%s) did not preserve 32-bitness\n", testName);
360 if(latin1Linear!=trie.isLatin1Linear) {
361 log_err("error: trie serialization (%s) did not preserve Latin-1-linearity\n", testName);
364 /* verify that all these values are in the unserialized Trie */
379 value2=UTRIE_GET32_FROM_BMP(&trie, start);
381 value2=UTRIE_GET16_FROM_BMP(&trie, start);
384 log_err("error: unserialized trie(%s).fromBMP(U+%04lx)==0x%lx instead of 0x%lx\n",
389 value2=UTRIE_GET32_FROM_LEAD(&trie, start);
391 value2=UTRIE_GET16_FROM_LEAD(&trie, start);
394 log_err("error: unserialized trie(%s).fromLead(U+%04lx)==0x%lx instead of 0x%lx\n",
400 UTRIE_GET32(&trie, start, value2);
402 UTRIE_GET16(&trie, start, value2);
405 log_err("error: unserialized trie(%s).get(U+%04lx)==0x%lx instead of 0x%lx\n",
414 utrie_enum(&trie, _testEnumValue, _testEnumRange, &enumRanges);
417 if(trie.isLatin1Linear) {
418 if(trie.data32!=NULL) {
419 const uint32_t *latin1=UTRIE_GET32_LATIN1(&trie);
422 if(latin1[start]!=UTRIE_GET32_FROM_LEAD(&trie, start)) {
423 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get32(U+%04lx)\n",
424 testName, start, latin1[start], UTRIE_GET32_FROM_LEAD(&trie, start), start);
428 const uint16_t *latin1=UTRIE_GET16_LATIN1(&trie);
431 if(latin1[start]!=UTRIE_GET16_FROM_LEAD(&trie, start)) {
432 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get16(U+%04lx)\n",
433 testName, start, latin1[start], UTRIE_GET16_FROM_LEAD(&trie, start), start);
439 testTrieIteration(testName, &trie, checkRanges, countCheckRanges);
456 UTrie trie={ 0 };
463 log_verbose("\ntesting Trie '%s'\n", testName);
482 log_err("error: setting values into a trie failed (%s)\n", testName);
486 /* verify that all these values are in the new Trie */
558 if(!utrie_unserialize(&trie, storageHolder.storage, length, &errorCode)) {
563 trie.getFoldingOffset=getFoldingOffset;
566 if(dataIs32!=(trie.data32!=NULL)) {
567 log_err("error: trie serialization (%s) did not preserve 32-bitness\n", testName);
569 if(latin1Linear!=trie.isLatin1Linear) {
570 log_err("error: trie serialization (%s) did not preserve Latin-1-linearity\n", testName);
573 /* verify that all these values are in the unserialized Trie */
588 value2=UTRIE_GET32_FROM_BMP(&trie, start);
590 value2=UTRIE_GET16_FROM_BMP(&trie, start);
593 log_err("error: unserialized trie(%s).fromBMP(U+%04lx)==0x%lx instead of 0x%lx\n",
598 value2=UTRIE_GET32_FROM_LEAD(&trie, start);
600 value2=UTRIE_GET16_FROM_LEAD(&trie, start);
603 log_err("error: unserialized trie(%s).fromLead(U+%04lx)==0x%lx instead of 0x%lx\n",
609 UTRIE_GET32(&trie, start, value2);
611 UTRIE_GET16(&trie, start, value2);
614 log_err("error: unserialized trie(%s).get(U+%04lx)==0x%lx instead of 0x%lx\n",
623 utrie_enum(&trie, _testEnumValue, _testEnumRange, &enumRanges);
626 if(trie.isLatin1Linear) {
627 if(trie.data32!=NULL) {
628 const uint32_t *latin1=UTRIE_GET32_LATIN1(&trie);
631 if(latin1[start]!=UTRIE_GET32_FROM_LEAD(&trie, start)) {
632 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get32(U+%04lx)\n",
633 testName, start, latin1[start], UTRIE_GET32_FROM_LEAD(&trie, start), start);
637 const uint16_t *latin1=UTRIE_GET16_LATIN1(&trie);
640 if(latin1[start]!=UTRIE_GET16_FROM_LEAD(&trie, start)) {
641 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get16(U+%04lx)\n",
642 testName, start, latin1[start], UTRIE_GET16_FROM_LEAD(&trie, start), start);
648 testTrieIteration(testName, &trie, checkRanges, countCheckRanges);
824 UTrie trie;
839 utrie_unserializeDummy(&trie, mem, sizeof(mem), initialValue, leadUnitValue, make16BitTrie, &errorCode);
844 trie.getFoldingOffset=dummyGetFoldingOffset;
849 UTRIE_GET16(&trie, c, value);
851 UTRIE_GET32(&trie, c, value);
862 value=UTRIE_GET16_FROM_LEAD(&trie, c);
864 value=UTRIE_GET32_FROM_LEAD(&trie, c);