Lines Matching refs:trie
56 _testFoldedValue32(UNewTrie *trie, UChar32 start, int32_t offset) {
65 value=utrie_get32(trie, start, &inBlockZero);
87 _testFoldedValue16(UNewTrie *trie, UChar32 start, int32_t offset) {
96 value=utrie_get32(trie, start, &inBlockZero);
142 const UTrie *trie,
171 if(trie->data32!=NULL) {
172 UTRIE_NEXT32(trie, p, limit, c, c2, value);
174 UTRIE_NEXT16(trie, p, limit, c, c2, value);
192 if(trie->data32==NULL) {
193 value=UTRIE_GET16_FROM_LEAD(trie, c);
194 offset=trie->getFoldingOffset(value);
196 value=UTRIE_GET16_FROM_OFFSET_TRAIL(trie, offset, c2);
198 value=trie->initialValue;
201 value=UTRIE_GET32_FROM_LEAD(trie, c);
202 offset=trie->getFoldingOffset(value);
204 value=UTRIE_GET32_FROM_OFFSET_TRAIL(trie, offset, c2);
206 value=trie->initialValue;
216 if(trie->data32==NULL) {
217 UTRIE_GET16_FROM_PAIR(trie, c, c2, value);
219 UTRIE_GET32_FROM_PAIR(trie, c, c2, value);
235 if(trie->data32!=NULL) {
236 UTRIE_PREVIOUS32(trie, s, p, c, c2, value);
238 UTRIE_PREVIOUS16(trie, s, p, c, c2, value);
263 UTrie trie={ 0 };
273 log_verbose("\ntesting Trie '%s'\n", testName);
292 log_err("error: setting values into a trie failed (%s)\n", testName);
296 /* verify that all these values are in the new Trie */
352 if(!utrie_unserialize(&trie, storage, length, &errorCode)) {
356 trie.getFoldingOffset=getFoldingOffset;
358 if(dataIs32!=(trie.data32!=NULL)) {
359 log_err("error: trie serialization (%s) did not preserve 32-bitness\n", testName);
361 if(latin1Linear!=trie.isLatin1Linear) {
362 log_err("error: trie serialization (%s) did not preserve Latin-1-linearity\n", testName);
365 /* verify that all these values are in the unserialized Trie */
380 value2=UTRIE_GET32_FROM_BMP(&trie, start);
382 value2=UTRIE_GET16_FROM_BMP(&trie, start);
385 log_err("error: unserialized trie(%s).fromBMP(U+%04lx)==0x%lx instead of 0x%lx\n",
390 value2=UTRIE_GET32_FROM_LEAD(&trie, start);
392 value2=UTRIE_GET16_FROM_LEAD(&trie, start);
395 log_err("error: unserialized trie(%s).fromLead(U+%04lx)==0x%lx instead of 0x%lx\n",
401 UTRIE_GET32(&trie, start, value2);
403 UTRIE_GET16(&trie, start, value2);
406 log_err("error: unserialized trie(%s).get(U+%04lx)==0x%lx instead of 0x%lx\n",
415 utrie_enum(&trie, _testEnumValue, _testEnumRange, &enumRanges);
418 if(trie.isLatin1Linear) {
419 if(trie.data32!=NULL) {
420 const uint32_t *latin1=UTRIE_GET32_LATIN1(&trie);
423 if(latin1[start]!=UTRIE_GET32_FROM_LEAD(&trie, start)) {
424 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get32(U+%04lx)\n",
425 testName, start, latin1[start], UTRIE_GET32_FROM_LEAD(&trie, start), start);
429 const uint16_t *latin1=UTRIE_GET16_LATIN1(&trie);
432 if(latin1[start]!=UTRIE_GET16_FROM_LEAD(&trie, start)) {
433 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get16(U+%04lx)\n",
434 testName, start, latin1[start], UTRIE_GET16_FROM_LEAD(&trie, start), start);
440 testTrieIteration(testName, &trie, checkRanges, countCheckRanges);
457 UTrie trie={ 0 };
464 log_verbose("\ntesting Trie '%s'\n", testName);
483 log_err("error: setting values into a trie failed (%s)\n", testName);
487 /* verify that all these values are in the new Trie */
559 if(!utrie_unserialize(&trie, storageHolder.storage, length, &errorCode)) {
564 trie.getFoldingOffset=getFoldingOffset;
567 if(dataIs32!=(trie.data32!=NULL)) {
568 log_err("error: trie serialization (%s) did not preserve 32-bitness\n", testName);
570 if(latin1Linear!=trie.isLatin1Linear) {
571 log_err("error: trie serialization (%s) did not preserve Latin-1-linearity\n", testName);
574 /* verify that all these values are in the unserialized Trie */
589 value2=UTRIE_GET32_FROM_BMP(&trie, start);
591 value2=UTRIE_GET16_FROM_BMP(&trie, start);
594 log_err("error: unserialized trie(%s).fromBMP(U+%04lx)==0x%lx instead of 0x%lx\n",
599 value2=UTRIE_GET32_FROM_LEAD(&trie, start);
601 value2=UTRIE_GET16_FROM_LEAD(&trie, start);
604 log_err("error: unserialized trie(%s).fromLead(U+%04lx)==0x%lx instead of 0x%lx\n",
610 UTRIE_GET32(&trie, start, value2);
612 UTRIE_GET16(&trie, start, value2);
615 log_err("error: unserialized trie(%s).get(U+%04lx)==0x%lx instead of 0x%lx\n",
624 utrie_enum(&trie, _testEnumValue, _testEnumRange, &enumRanges);
627 if(trie.isLatin1Linear) {
628 if(trie.data32!=NULL) {
629 const uint32_t *latin1=UTRIE_GET32_LATIN1(&trie);
632 if(latin1[start]!=UTRIE_GET32_FROM_LEAD(&trie, start)) {
633 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get32(U+%04lx)\n",
634 testName, start, latin1[start], UTRIE_GET32_FROM_LEAD(&trie, start), start);
638 const uint16_t *latin1=UTRIE_GET16_LATIN1(&trie);
641 if(latin1[start]!=UTRIE_GET16_FROM_LEAD(&trie, start)) {
642 log_err("error: (%s) trie.latin1[U+%04lx]=0x%lx!=0x%lx=trie.get16(U+%04lx)\n",
643 testName, start, latin1[start], UTRIE_GET16_FROM_LEAD(&trie, start), start);
649 testTrieIteration(testName, &trie, checkRanges, countCheckRanges);
825 UTrie trie;
840 utrie_unserializeDummy(&trie, mem, sizeof(mem), initialValue, leadUnitValue, make16BitTrie, &errorCode);
845 trie.getFoldingOffset=dummyGetFoldingOffset;
850 UTRIE_GET16(&trie, c, value);
852 UTRIE_GET32(&trie, c, value);
863 value=UTRIE_GET16_FROM_LEAD(&trie, c);
865 value=UTRIE_GET32_FROM_LEAD(&trie, c);