// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * * Copyright (C) 2001-2014, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** * file name: trietest.c * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * created on: 2008sep01 (starting from a copy of trietest.c) * created by: Markus W. Scherer */ #include #include "unicode/utypes.h" #include "unicode/utf8.h" #include "utrie2.h" #include "utrie.h" #include "cstring.h" #include "cmemory.h" #include "udataswp.h" #include "cintltst.h" void addTrie2Test(TestNode** root); /* Values for setting possibly overlapping, out-of-order ranges of values */ typedef struct SetRange { UChar32 start, limit; uint32_t value; UBool overwrite; } SetRange; /* * Values for testing: * value is set from the previous boundary's limit to before * this boundary's limit * * There must be an entry with limit 0 and the intialValue. * It may be preceded by an entry with negative limit and the errorValue. */ typedef struct CheckRange { UChar32 limit; uint32_t value; } CheckRange; static int32_t skipSpecialValues(const CheckRange checkRanges[], int32_t countCheckRanges) { int32_t i; for(i=0; ilimit || limit!=b->limit || value!=b->value) { log_err("error: utrie2_enum() delivers wrong range [U+%04lx..U+%04lx].0x%lx instead of [U+%04lx..U+%04lx].0x%lx\n", (long)start, (long)end, (long)value, (long)(b-1)->limit, (long)b->limit-1, (long)b->value); } return TRUE; } static void testTrieEnum(const char *testName, const UTrie2 *trie, const CheckRange checkRanges[], int32_t countCheckRanges) { /* skip over special values */ while(countCheckRanges>0 && checkRanges[0].limit<=0) { ++checkRanges; --countCheckRanges; } utrie2_enum(trie, testEnumValue, testEnumRange, &checkRanges); } /* verify all expected values via UTRIE2_GETxx() */ static void testTrieGetters(const char *testName, const UTrie2 *trie, UTrie2ValueBits valueBits, const CheckRange checkRanges[], int32_t countCheckRanges) { uint32_t initialValue, errorValue; uint32_t value, value2; UChar32 start, limit; int32_t i, countSpecials; UBool isFrozen=utrie2_isFrozen(trie); const char *const typeName= isFrozen ? "frozen trie" : "newTrie"; countSpecials=getSpecialValues(checkRanges, countCheckRanges, &initialValue, &errorValue); start=0; for(i=countSpecials; idata16[start]; } else { value2=trie->data32[start]; } if(value!=value2) { log_err("error: %s(%s).asciiData[U+%04lx]==0x%lx instead of 0x%lx\n", typeName, testName, (long)start, (long)value2, (long)value); } ++start; } } while(start<=0xbf) { if(valueBits==UTRIE2_16_VALUE_BITS) { value2=trie->data16[start]; } else { value2=trie->data32[start]; } if(errorValue!=value2) { log_err("error: %s(%s).badData[U+%04lx]==0x%lx instead of 0x%lx\n", typeName, testName, (long)start, (long)value2, (long)errorValue); } ++start; } } if(0!=strncmp(testName, "dummy", 5) && 0!=strncmp(testName, "trie1", 5)) { /* test values for lead surrogate code units */ for(start=0xd7ff; start<0xdc01; ++start) { switch(start) { case 0xd7ff: case 0xdc00: value=errorValue; break; case 0xd800: value=90; break; case 0xd999: value=94; break; case 0xdbff: value=99; break; default: value=initialValue; break; } if(isFrozen && U_IS_LEAD(start)) { if(valueBits==UTRIE2_16_VALUE_BITS) { value2=UTRIE2_GET16_FROM_U16_SINGLE_LEAD(trie, start); } else { value2=UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, start); } if(value2!=value) { log_err("error: %s(%s).LSCU(U+%04lx)==0x%lx instead of 0x%lx\n", typeName, testName, (long)start, (long)value2, (long)value); } } value2=utrie2_get32FromLeadSurrogateCodeUnit(trie, start); if(value2!=value) { log_err("error: %s(%s).lscu(U+%04lx)==0x%lx instead of 0x%lx\n", typeName, testName, (long)start, (long)value2, (long)value); } } } /* test errorValue */ if(isFrozen) { if(valueBits==UTRIE2_16_VALUE_BITS) { value=UTRIE2_GET16(trie, -1); value2=UTRIE2_GET16(trie, 0x110000); } else { value=UTRIE2_GET32(trie, -1); value2=UTRIE2_GET32(trie, 0x110000); } if(value!=errorValue || value2!=errorValue) { log_err("error: %s(%s).get(out of range) != errorValue\n", typeName, testName); } } value=utrie2_get32(trie, -1); value2=utrie2_get32(trie, 0x110000); if(value!=errorValue || value2!=errorValue) { log_err("error: %s(%s).get32(out of range) != errorValue\n", typeName, testName); } } static void testTrieUTF16(const char *testName, const UTrie2 *trie, UTrie2ValueBits valueBits, const CheckRange checkRanges[], int32_t countCheckRanges) { UChar s[200]; uint32_t values[100]; const UChar *p, *limit; uint32_t value; UChar32 prevCP, c, c2; int32_t i, length, sIndex, countValues; /* write a string */ prevCP=0; length=countValues=0; for(i=skipSpecialValues(checkRanges, countCheckRanges); iU+%04lx): 0x%lx instead of 0x%lx\n", testName, (unsigned long)bytes, (long)c, (long)value, (long)values[i]); } if(i8!=(p-s)) { log_err("error: wrong end index from UTRIE2_U8_NEXT(%s)(%lx->U+%04lx): %ld != %ld\n", testName, (unsigned long)bytes, (long)c, (long)(p-s), (long)i8); continue; } ++i; } /* try backward */ p=limit; i=countValues; while(sU+%04lx): 0x%lx instead of 0x%lx\n", testName, (unsigned long)bytes, (long)c, (long)value, (long)values[i]); } if(i8!=(p-s)) { log_err("error: wrong end index from UTRIE2_U8_PREV(%s)(%lx->U+%04lx): %ld != %ld\n", testName, (unsigned long)bytes, (long)c, (long)(p-s), (long)i8); continue; } } } static void testFrozenTrie(const char *testName, UTrie2 *trie, UTrie2ValueBits valueBits, const CheckRange checkRanges[], int32_t countCheckRanges) { UErrorCode errorCode; uint32_t value, value2; if(!utrie2_isFrozen(trie)) { log_err("error: utrie2_isFrozen(frozen %s) returned FALSE (not frozen)\n", testName); return; } testTrieGetters(testName, trie, valueBits, checkRanges, countCheckRanges); testTrieEnum(testName, trie, checkRanges, countCheckRanges); testTrieUTF16(testName, trie, valueBits, checkRanges, countCheckRanges); testTrieUTF8(testName, trie, valueBits, checkRanges, countCheckRanges); errorCode=U_ZERO_ERROR; value=utrie2_get32(trie, 1); utrie2_set32(trie, 1, 234, &errorCode); value2=utrie2_get32(trie, 1); if(errorCode!=U_NO_WRITE_PERMISSION || value2!=value) { log_err("error: utrie2_set32(frozen %s) failed: it set %s != U_NO_WRITE_PERMISSION\n", testName, u_errorName(errorCode)); return; } errorCode=U_ZERO_ERROR; utrie2_setRange32(trie, 1, 5, 234, TRUE, &errorCode); value2=utrie2_get32(trie, 1); if(errorCode!=U_NO_WRITE_PERMISSION || value2!=value) { log_err("error: utrie2_setRange32(frozen %s) failed: it set %s != U_NO_WRITE_PERMISSION\n", testName, u_errorName(errorCode)); return; } errorCode=U_ZERO_ERROR; value=utrie2_get32FromLeadSurrogateCodeUnit(trie, 0xd801); utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd801, 234, &errorCode); value2=utrie2_get32FromLeadSurrogateCodeUnit(trie, 0xd801); if(errorCode!=U_NO_WRITE_PERMISSION || value2!=value) { log_err("error: utrie2_set32ForLeadSurrogateCodeUnit(frozen %s) failed: " "it set %s != U_NO_WRITE_PERMISSION\n", testName, u_errorName(errorCode)); return; } } static void testNewTrie(const char *testName, const UTrie2 *trie, const CheckRange checkRanges[], int32_t countCheckRanges) { /* The valueBits are ignored for an unfrozen trie. */ testTrieGetters(testName, trie, UTRIE2_COUNT_VALUE_BITS, checkRanges, countCheckRanges); testTrieEnum(testName, trie, checkRanges, countCheckRanges); } static void testTrieSerialize(const char *testName, UTrie2 *trie, UTrie2ValueBits valueBits, UBool withSwap, const CheckRange checkRanges[], int32_t countCheckRanges) { uint32_t storage[10000]; int32_t length1, length2, length3; UTrie2ValueBits otherValueBits; UErrorCode errorCode; /* clone the trie so that the caller can reuse the original */ errorCode=U_ZERO_ERROR; trie=utrie2_clone(trie, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: utrie2_clone(unfrozen %s) failed - %s\n", testName, u_errorName(errorCode)); return; } /* * This is not a loop, but simply a block that we can exit with "break" * when something goes wrong. */ do { errorCode=U_ZERO_ERROR; utrie2_serialize(trie, storage, sizeof(storage), &errorCode); if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) { log_err("error: utrie2_serialize(unfrozen %s) set %s != U_ILLEGAL_ARGUMENT_ERROR\n", testName, u_errorName(errorCode)); break; } errorCode=U_ZERO_ERROR; utrie2_freeze(trie, valueBits, &errorCode); if(U_FAILURE(errorCode) || !utrie2_isFrozen(trie)) { log_err("error: utrie2_freeze(%s) failed: %s isFrozen: %d\n", testName, u_errorName(errorCode), utrie2_isFrozen(trie)); break; } otherValueBits= valueBits==UTRIE2_16_VALUE_BITS ? UTRIE2_32_VALUE_BITS : UTRIE2_16_VALUE_BITS; utrie2_freeze(trie, otherValueBits, &errorCode); if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) { log_err("error: utrie2_freeze(already-frozen with other valueBits %s) " "set %s != U_ILLEGAL_ARGUMENT_ERROR\n", testName, u_errorName(errorCode)); break; } errorCode=U_ZERO_ERROR; if(withSwap) { /* clone a frozen trie */ UTrie2 *clone=utrie2_clone(trie, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: cloning a frozen UTrie2 failed (%s) - %s\n", testName, u_errorName(errorCode)); errorCode=U_ZERO_ERROR; /* continue with the original */ } else { utrie2_close(trie); trie=clone; } } length1=utrie2_serialize(trie, NULL, 0, &errorCode); if(errorCode!=U_BUFFER_OVERFLOW_ERROR) { log_err("error: utrie2_serialize(%s) preflighting set %s != U_BUFFER_OVERFLOW_ERROR\n", testName, u_errorName(errorCode)); break; } errorCode=U_ZERO_ERROR; length2=utrie2_serialize(trie, storage, sizeof(storage), &errorCode); if(errorCode==U_BUFFER_OVERFLOW_ERROR) { log_err("error: utrie2_serialize(%s) needs more memory\n", testName); break; } if(U_FAILURE(errorCode)) { log_err("error: utrie2_serialize(%s) failed: %s\n", testName, u_errorName(errorCode)); break; } if(length1!=length2) { log_err("error: trie serialization (%s) lengths different: " "preflight vs. serialize\n", testName); break; } testFrozenTrie(testName, trie, valueBits, checkRanges, countCheckRanges); utrie2_close(trie); trie=NULL; if(withSwap) { uint32_t swapped[10000]; int32_t swappedLength; UDataSwapper *ds; /* swap to opposite-endian */ uprv_memset(swapped, 0x55, length2); ds=udata_openSwapper(U_IS_BIG_ENDIAN, U_CHARSET_FAMILY, !U_IS_BIG_ENDIAN, U_CHARSET_FAMILY, &errorCode); swappedLength=utrie2_swap(ds, storage, -1, NULL, &errorCode); if(U_FAILURE(errorCode) || swappedLength!=length2) { log_err("error: utrie2_swap(%s to OE preflighting) failed (%s) " "or before/after lengths different\n", testName, u_errorName(errorCode)); udata_closeSwapper(ds); break; } swappedLength=utrie2_swap(ds, storage, length2, swapped, &errorCode); udata_closeSwapper(ds); if(U_FAILURE(errorCode) || swappedLength!=length2) { log_err("error: utrie2_swap(%s to OE) failed (%s) or before/after lengths different\n", testName, u_errorName(errorCode)); break; } /* swap back to platform-endian */ uprv_memset(storage, 0xaa, length2); ds=udata_openSwapper(!U_IS_BIG_ENDIAN, U_CHARSET_FAMILY, U_IS_BIG_ENDIAN, U_CHARSET_FAMILY, &errorCode); swappedLength=utrie2_swap(ds, swapped, -1, NULL, &errorCode); if(U_FAILURE(errorCode) || swappedLength!=length2) { log_err("error: utrie2_swap(%s to PE preflighting) failed (%s) " "or before/after lengths different\n", testName, u_errorName(errorCode)); udata_closeSwapper(ds); break; } swappedLength=utrie2_swap(ds, swapped, length2, storage, &errorCode); udata_closeSwapper(ds); if(U_FAILURE(errorCode) || swappedLength!=length2) { log_err("error: utrie2_swap(%s to PE) failed (%s) or before/after lengths different\n", testName, u_errorName(errorCode)); break; } } trie=utrie2_openFromSerialized(valueBits, storage, length2, &length3, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: utrie2_openFromSerialized(%s) failed, %s\n", testName, u_errorName(errorCode)); break; } if((valueBits==UTRIE2_16_VALUE_BITS)!=(trie->data32==NULL)) { log_err("error: trie serialization (%s) did not preserve 32-bitness\n", testName); break; } if(length2!=length3) { log_err("error: trie serialization (%s) lengths different: " "serialize vs. unserialize\n", testName); break; } /* overwrite the storage that is not supposed to be needed */ uprv_memset((char *)storage+length3, 0xfa, (int32_t)(sizeof(storage)-length3)); utrie2_freeze(trie, valueBits, &errorCode); if(U_FAILURE(errorCode) || !utrie2_isFrozen(trie)) { log_err("error: utrie2_freeze(unserialized %s) failed: %s isFrozen: %d\n", testName, u_errorName(errorCode), utrie2_isFrozen(trie)); break; } utrie2_freeze(trie, otherValueBits, &errorCode); if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) { log_err("error: utrie2_freeze(unserialized with other valueBits %s) " "set %s != U_ILLEGAL_ARGUMENT_ERROR\n", testName, u_errorName(errorCode)); break; } errorCode=U_ZERO_ERROR; if(withSwap) { /* clone an unserialized trie */ UTrie2 *clone=utrie2_clone(trie, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: utrie2_clone(unserialized %s) failed - %s\n", testName, u_errorName(errorCode)); errorCode=U_ZERO_ERROR; /* no need to break: just test the original trie */ } else { utrie2_close(trie); trie=clone; uprv_memset(storage, 0, sizeof(storage)); } } testFrozenTrie(testName, trie, valueBits, checkRanges, countCheckRanges); { /* clone-as-thawed an unserialized trie */ UTrie2 *clone=utrie2_cloneAsThawed(trie, &errorCode); if(U_FAILURE(errorCode) || utrie2_isFrozen(clone)) { log_err("error: utrie2_cloneAsThawed(unserialized %s) failed - " "%s (isFrozen: %d)\n", testName, u_errorName(errorCode), clone!=NULL && utrie2_isFrozen(trie)); break; } else { utrie2_close(trie); trie=clone; } } { uint32_t value, value2; value=utrie2_get32(trie, 0xa1); utrie2_set32(trie, 0xa1, 789, &errorCode); value2=utrie2_get32(trie, 0xa1); utrie2_set32(trie, 0xa1, value, &errorCode); if(U_FAILURE(errorCode) || value2!=789) { log_err("error: modifying a cloneAsThawed UTrie2 (%s) failed - %s\n", testName, u_errorName(errorCode)); } } testNewTrie(testName, trie, checkRanges, countCheckRanges); } while(0); utrie2_close(trie); } static UTrie2 * testTrieSerializeAllValueBits(const char *testName, UTrie2 *trie, UBool withClone, const CheckRange checkRanges[], int32_t countCheckRanges) { char name[40]; /* verify that all the expected values are in the unfrozen trie */ testNewTrie(testName, trie, checkRanges, countCheckRanges); /* * Test with both valueBits serializations, * and that utrie2_serialize() can be called multiple times. */ uprv_strcpy(name, testName); uprv_strcat(name, ".16"); testTrieSerialize(name, trie, UTRIE2_16_VALUE_BITS, withClone, checkRanges, countCheckRanges); if(withClone) { /* * try cloning after the first serialization; * clone-as-thawed just to sometimes try it on an unfrozen trie */ UErrorCode errorCode=U_ZERO_ERROR; UTrie2 *clone=utrie2_cloneAsThawed(trie, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: utrie2_cloneAsThawed(%s) after serialization failed - %s\n", testName, u_errorName(errorCode)); } else { utrie2_close(trie); trie=clone; testNewTrie(testName, trie, checkRanges, countCheckRanges); } } uprv_strcpy(name, testName); uprv_strcat(name, ".32"); testTrieSerialize(name, trie, UTRIE2_32_VALUE_BITS, withClone, checkRanges, countCheckRanges); return trie; /* could be the clone */ } static UTrie2 * makeTrieWithRanges(const char *testName, UBool withClone, const SetRange setRanges[], int32_t countSetRanges, const CheckRange checkRanges[], int32_t countCheckRanges) { UTrie2 *trie; uint32_t initialValue, errorValue; uint32_t value; UChar32 start, limit; int32_t i; UErrorCode errorCode; UBool overwrite; log_verbose("\ntesting Trie '%s'\n", testName); errorCode=U_ZERO_ERROR; getSpecialValues(checkRanges, countCheckRanges, &initialValue, &errorValue); trie=utrie2_open(initialValue, errorValue, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: utrie2_open(%s) failed: %s\n", testName, u_errorName(errorCode)); return NULL; } /* set values from setRanges[] */ for(i=0; i>UTRIE2_SHIFT_2)/2; ++i) { utrie2_setRange32(trie, 0x740, 0x840-1, 1, TRUE, &errorCode); utrie2_setRange32(trie, 0x780, 0x880-1, 1, TRUE, &errorCode); utrie2_setRange32(trie, 0x740, 0x840-1, 2, TRUE, &errorCode); utrie2_setRange32(trie, 0x780, 0x880-1, 3, TRUE, &errorCode); } /* make blocks that will be free during compaction */ utrie2_setRange32(trie, 0x1000, 0x3000-1, 2, TRUE, &errorCode); utrie2_setRange32(trie, 0x2000, 0x4000-1, 3, TRUE, &errorCode); utrie2_setRange32(trie, 0x1000, 0x4000-1, 1, TRUE, &errorCode); /* set some values for lead surrogate code units */ utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd800, 90, &errorCode); utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd999, 94, &errorCode); utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xdbff, 99, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: setting lots of ranges into a trie (%s) failed - %s\n", testName, u_errorName(errorCode)); utrie2_close(trie); return; } trie=testTrieSerializeAllValueBits(testName, trie, FALSE, checkRanges, UPRV_LENGTHOF(checkRanges)); utrie2_close(trie); } static void GrowDataArrayTest(void) { static const CheckRange checkRanges[]={ { 0, 1 }, { 0x720, 2 }, { 0x7a0, 3 }, { 0x8a0, 4 }, { 0x110000, 5 } }; static const char *const testName="grow-data"; UTrie2 *trie; int32_t i; UErrorCode errorCode; errorCode=U_ZERO_ERROR; trie=utrie2_open(1, 0xbad, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: utrie2_open(%s) failed: %s\n", testName, u_errorName(errorCode)); return; } /* * Use utrie2_set32() not utrie2_setRange32() to write non-initialValue-data. * Should grow/reallocate the data array to a sufficient length. */ for(i=0; i<0x1000; ++i) { utrie2_set32(trie, i, 2, &errorCode); } for(i=0x720; i<0x1100; ++i) { /* some overlap */ utrie2_set32(trie, i, 3, &errorCode); } for(i=0x7a0; i<0x900; ++i) { utrie2_set32(trie, i, 4, &errorCode); } for(i=0x8a0; i<0x110000; ++i) { utrie2_set32(trie, i, 5, &errorCode); } for(i=0xd800; i<0xdc00; ++i) { utrie2_set32ForLeadSurrogateCodeUnit(trie, i, 1, &errorCode); } /* set some values for lead surrogate code units */ utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd800, 90, &errorCode); utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xd999, 94, &errorCode); utrie2_set32ForLeadSurrogateCodeUnit(trie, 0xdbff, 99, &errorCode); if(U_FAILURE(errorCode)) { log_err("error: setting lots of values into a trie (%s) failed - %s\n", testName, u_errorName(errorCode)); utrie2_close(trie); return; } trie=testTrieSerializeAllValueBits(testName, trie, FALSE, checkRanges, UPRV_LENGTHOF(checkRanges)); utrie2_close(trie); } /* versions 1 and 2 --------------------------------------------------------- */ static void GetVersionTest(void) { uint32_t data[4]; if( /* version 1 */ (data[0]=0x54726965, 1!=utrie2_getVersion(data, sizeof(data), FALSE)) || (data[0]=0x54726965, 1!=utrie2_getVersion(data, sizeof(data), TRUE)) || (data[0]=0x65697254, 0!=utrie2_getVersion(data, sizeof(data), FALSE)) || (data[0]=0x65697254, 1!=utrie2_getVersion(data, sizeof(data), TRUE)) || /* version 2 */ (data[0]=0x54726932, 2!=utrie2_getVersion(data, sizeof(data), FALSE)) || (data[0]=0x54726932, 2!=utrie2_getVersion(data, sizeof(data), TRUE)) || (data[0]=0x32697254, 0!=utrie2_getVersion(data, sizeof(data), FALSE)) || (data[0]=0x32697254, 2!=utrie2_getVersion(data, sizeof(data), TRUE)) || /* illegal arguments */ (data[0]=0x54726932, 0!=utrie2_getVersion(NULL, sizeof(data), FALSE)) || (data[0]=0x54726932, 0!=utrie2_getVersion(data, 3, FALSE)) || (data[0]=0x54726932, 0!=utrie2_getVersion((char *)data+1, sizeof(data), FALSE)) || /* unknown signature values */ (data[0]=0x11223344, 0!=utrie2_getVersion(data, sizeof(data), FALSE)) || (data[0]=0x54726933, 0!=utrie2_getVersion(data, sizeof(data), FALSE)) ) { log_err("error: utrie2_getVersion() is not working as expected\n"); } } static UNewTrie * makeNewTrie1WithRanges(const char *testName, const SetRange setRanges[], int32_t countSetRanges, const CheckRange checkRanges[], int32_t countCheckRanges) { UNewTrie *newTrie; uint32_t initialValue, errorValue; uint32_t value; UChar32 start, limit; int32_t i; UErrorCode errorCode; UBool overwrite, ok; log_verbose("\ntesting Trie '%s'\n", testName); errorCode=U_ZERO_ERROR; getSpecialValues(checkRanges, countCheckRanges, &initialValue, &errorValue); newTrie=utrie_open(NULL, NULL, 2000, initialValue, initialValue, FALSE); if(U_FAILURE(errorCode)) { log_err("error: utrie_open(%s) failed: %s\n", testName, u_errorName(errorCode)); return NULL; } /* set values from setRanges[] */ ok=TRUE; for(i=0; itrie2", setRanges2, UPRV_LENGTHOF(setRanges2), checkRanges2, UPRV_LENGTHOF(checkRanges2)); } void addTrie2Test(TestNode** root) { addTest(root, &TrieTest, "tsutil/trie2test/TrieTest"); addTest(root, &EnumNewTrieForLeadSurrogateTest, "tsutil/trie2test/EnumNewTrieForLeadSurrogateTest"); addTest(root, &DummyTrieTest, "tsutil/trie2test/DummyTrieTest"); addTest(root, &FreeBlocksTest, "tsutil/trie2test/FreeBlocksTest"); addTest(root, &GrowDataArrayTest, "tsutil/trie2test/GrowDataArrayTest"); addTest(root, &GetVersionTest, "tsutil/trie2test/GetVersionTest"); addTest(root, &Trie12ConversionTest, "tsutil/trie2test/Trie12ConversionTest"); }