Lines Matching refs:ut
25 UText *openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
167 UText *ut = NULL; in TestString() local
193 ut = utext_openUChars(NULL, buf, -1, &status); in TestString()
195 TestAccess(sa, ut, cpCount, cpMap); in TestString()
196 utext_close(ut); in TestString()
204 ut = utext_openUChars(NULL, buf, saLen, &status); in TestString()
206 TestAccess(sa, ut, cpCount, cpMap); in TestString()
207 utext_close(ut); in TestString()
213 ut = utext_openUnicodeString(NULL, &sa, &status); in TestString()
215 TestAccess(sa, ut, cpCount, cpMap); in TestString()
216 TestCMR(sa, ut, cpCount, cpMap, cpMap); in TestString()
217 utext_close(ut); in TestString()
222 ut = utext_openConstUnicodeString(NULL, &sa, &status); in TestString()
224 TestAccess(sa, ut, cpCount, cpMap); in TestString()
225 utext_close(ut); in TestString()
230 ut = utext_openReplaceable(NULL, &sa, &status); in TestString()
232 TestAccess(sa, ut, cpCount, cpMap); in TestString()
233 TestCMR(sa, ut, cpCount, cpMap, cpMap); in TestString()
234 utext_close(ut); in TestString()
241 ut = utext_openCharacterIterator(NULL, ci, &status); in TestString()
243 TestAccess(sa, ut, cpCount, cpMap); in TestString()
244 utext_close(ut); in TestString()
251 ut = openFragmentedUnicodeString(NULL, &sa, &status); in TestString()
253 TestAccess(sa, ut, cpCount, cpMap); in TestString()
254 utext_close(ut); in TestString()
277 ut = utext_openUTF8(NULL, u8String, -1, &status); in TestString()
279 TestAccess(sa, ut, cpCount, u8Map); in TestString()
280 utext_close(ut); in TestString()
299 void UTextTest::TestCMR(const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *u16Map) { in TestCMR() argument
300 TEST_ASSERT(utext_isWritable(ut) == TRUE); in TestCMR()
369 TestCopyMove(us, ut, FALSE, in TestCMR()
373 TestCopyMove(us, ut, TRUE, in TestCMR()
388 TestReplace(us, ut, in TestCMR()
406 void UTextTest::TestCopyMove(const UnicodeString &us, UText *ut, UBool move, in TestCopyMove() argument
419 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status); in TestCopyMove()
463 int64_t expectedNativeLength = utext_nativeLength(ut); in TestCopyMove()
481 UText *ut, // UnicodeText object under test. in TestReplace() argument
497 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status); in TestReplace()
540 expectedNativeLength = utext_nativeLength(ut) + expectedDelta; in TestReplace()
553 void UTextTest::TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) { in TestAccess() argument
555 TestAccessNoClone(us, ut, cpCount, cpMap); in TestAccess()
558 utext_setNativeIndex(ut, 0); in TestAccess()
560 UText *shallowClone = utext_clone(NULL, ut, FALSE /*deep*/, FALSE /*readOnly*/, &status); in TestAccess()
586 void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) { in TestAccessNoClone() argument
594 int64_t utlen = utext_nativeLength(ut); in TestAccessNoClone()
611 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
614 foundC = utext_next32(ut); in TestAccessNoClone()
616 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
622 foundC = utext_next32(ut); in TestAccessNoClone()
626 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
629 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
632 foundC = UTEXT_NEXT32(ut); in TestAccessNoClone()
638 foundC = UTEXT_NEXT32(ut); in TestAccessNoClone()
645 len = utext_nativeLength(ut); in TestAccessNoClone()
646 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
652 len = utext_getNativeIndex(ut); in TestAccessNoClone()
653 utext_setNativeIndex(ut, len); in TestAccessNoClone()
657 int64_t prevIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
658 foundC = utext_previous32(ut); in TestAccessNoClone()
659 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
672 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
674 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
678 foundC = utext_previous32(ut); in TestAccessNoClone()
680 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
682 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
687 utext_setNativeIndex(ut, len); in TestAccessNoClone()
691 foundC = UTEXT_PREVIOUS32(ut); in TestAccessNoClone()
692 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
704 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
707 foundC = UTEXT_PREVIOUS32(ut); in TestAccessNoClone()
709 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
723 foundC = utext_next32From(ut, index); in TestAccessNoClone()
735 foundC = utext_previous32From(ut, index); in TestAccessNoClone()
748 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
750 utext_moveIndex32(ut, 1); in TestAccessNoClone()
751 index = utext_getNativeIndex(ut); in TestAccessNoClone()
754 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
759 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
761 utext_moveIndex32(ut, 2); in TestAccessNoClone()
762 index = utext_getNativeIndex(ut); in TestAccessNoClone()
765 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
771 utext_setNativeIndex(ut, i); in TestAccessNoClone()
774 index = utext_getNativeIndex(ut); in TestAccessNoClone()
776 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
778 utext_moveIndex32(ut, -1); in TestAccessNoClone()
784 utext_setNativeIndex(ut, i); in TestAccessNoClone()
787 index = utext_getNativeIndex(ut); in TestAccessNoClone()
789 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
791 utext_moveIndex32(ut, -3); in TestAccessNoClone()
802 len = utext_extract(ut, 0, utlen, buf, bufSize, &status); in TestAccessNoClone()
809 len = utext_extract(ut, 0, utlen, NULL, 0, &status); in TestAccessNoClone()
819 len = utext_extract(ut, 0, utlen, buf, 1, &status); in TestAccessNoClone()
848 UText ut; in ErrorTest() local
849 memset(&ut, 0, sizeof(UText)); in ErrorTest()
850 utext_close(&ut); in ErrorTest()
857 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
859 UText *ut2 = utext_openUnicodeString(&ut, &s, &status); in ErrorTest()
861 TEST_ASSERT(ut2 == &ut); in ErrorTest()
863 UText *ut3 = utext_close(&ut); in ErrorTest()
864 TEST_ASSERT(ut3 == &ut); in ErrorTest()
866 UText *ut4 = utext_close(&ut); in ErrorTest()
867 TEST_ASSERT(ut4 == &ut); in ErrorTest()
869 utext_openUnicodeString(&ut, &s, &status); in ErrorTest()
871 utext_close(&ut); in ErrorTest()
878 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
884 utp = utext_openUnicodeString(&ut, &s1, &status); in ErrorTest()
886 TEST_ASSERT(utp == &ut); in ErrorTest()
888 utp = utext_openConstUnicodeString(&ut, &s1, &status); in ErrorTest()
890 TEST_ASSERT(utp == &ut); in ErrorTest()
892 utp = utext_openUTF8(&ut, s3, -1, &status); in ErrorTest()
894 TEST_ASSERT(utp == &ut); in ErrorTest()
896 utp = utext_openUChars(&ut, s2, -1, &status); in ErrorTest()
898 TEST_ASSERT(utp == &ut); in ErrorTest()
900 utp = utext_close(&ut); in ErrorTest()
901 TEST_ASSERT(utp == &ut); in ErrorTest()
903 utp = utext_openUnicodeString(&ut, &s1, &status); in ErrorTest()
905 TEST_ASSERT(utp == &ut); in ErrorTest()
912 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
914 utext_openUChars(&ut, NULL, 5, &status); in ErrorTest()
918 utext_openUChars(&ut, NULL, -1, &status); in ErrorTest()
922 utext_openUTF8(&ut, NULL, 4, &status); in ErrorTest()
926 utext_openUTF8(&ut, NULL, -1, &status); in ErrorTest()
936 UText *ut = NULL; in ErrorTest() local
940 ut = utext_openUTF8(NULL, badUTF8, -1, &status); in ErrorTest()
942 c = utext_char32At(ut, 1); in ErrorTest()
944 c = utext_char32At(ut, 3); in ErrorTest()
946 c = utext_char32At(ut, 5); in ErrorTest()
948 c = utext_char32At(ut, 6); in ErrorTest()
952 int n = utext_extract(ut, 0, 9, buf, 10, &status); in ErrorTest()
958 utext_close(ut); in ErrorTest()
1009 UText *ut = utext_openUTF8(NULL, u8str, -1, &status); in ErrorTest() local
1016 utext_setNativeIndex(ut, i); in ErrorTest()
1017 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1019 cpIndex = UTEXT_GETNATIVEINDEX(ut); in ErrorTest()
1025 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1027 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1033 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1035 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1042 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1044 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1054 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1065 utext_close(ut); in ErrorTest()
1082 UText *ut = utext_openUnicodeString(NULL, &u16str, &status); in ErrorTest() local
1088 utext_setNativeIndex(ut, i); in ErrorTest()
1089 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1095 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1097 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1103 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1105 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1111 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1113 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1123 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1134 utext_close(ut); in ErrorTest()
1150 UText *ut = utext_openReplaceable(NULL, &u16str, &status); in ErrorTest() local
1156 utext_setNativeIndex(ut, i); in ErrorTest()
1157 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1163 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1165 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1171 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1173 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1179 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1181 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1191 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1202 utext_close(ut); in ErrorTest()
1216 UText *ut = NULL; in FreezeTest() local
1219 ut = utext_openUTF8(ut, u8str, -1, &status); in FreezeTest()
1221 UBool writable = utext_isWritable(ut); in FreezeTest()
1223 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1227 ut = utext_openUChars(ut, u16str, -1, &status); in FreezeTest()
1229 writable = utext_isWritable(ut); in FreezeTest()
1231 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1235 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1237 writable = utext_isWritable(ut); in FreezeTest()
1239 utext_freeze(ut); in FreezeTest()
1240 writable = utext_isWritable(ut); in FreezeTest()
1242 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1246 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1248 ut2 = utext_clone(ut2, ut, FALSE, FALSE, &status); // clone with readonly = false in FreezeTest()
1252 ut2 = utext_clone(ut2, ut, FALSE, TRUE, &status); // clone with readonly = true in FreezeTest()
1260 ut = utext_openConstUnicodeString(ut, (const UnicodeString *)&ustr, &status); in FreezeTest()
1262 writable = utext_isWritable(ut); in FreezeTest()
1264 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1269 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1271 utext_freeze(ut); in FreezeTest()
1272 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone in FreezeTest()
1281 ut = utext_openUChars(ut, u16str, -1, &status); in FreezeTest()
1283 utext_freeze(ut); in FreezeTest()
1284 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone in FreezeTest()
1290 utext_close(ut); in FreezeTest()
1306 fragTextAccess(UText *ut, int64_t index, UBool forward) { in fragTextAccess() argument
1307 const UnicodeString *us = (const UnicodeString *)ut->context; in fragTextAccess()
1312 ut->b = c | c<<16; in fragTextAccess()
1313 ut->chunkOffset = 0; in fragTextAccess()
1314 ut->chunkLength = 1; in fragTextAccess()
1315 ut->chunkNativeStart = index; in fragTextAccess()
1316 ut->chunkNativeLimit = index+1; in fragTextAccess()
1321 ut->b = c | c<<16; in fragTextAccess()
1322 ut->chunkOffset = 1; in fragTextAccess()
1323 ut->chunkLength = 1; in fragTextAccess()
1324 ut->chunkNativeStart = index-1; in fragTextAccess()
1325 ut->chunkNativeLimit = index; in fragTextAccess()
1328 ut->b = 0; in fragTextAccess()
1329 ut->chunkOffset = 0; in fragTextAccess()
1330 ut->chunkLength = 0; in fragTextAccess()
1332 ut->chunkNativeStart = 0; in fragTextAccess()
1333 ut->chunkNativeLimit = 0; in fragTextAccess()
1335 ut->chunkNativeStart = length; in fragTextAccess()
1336 ut->chunkNativeLimit = length; in fragTextAccess()
1367 openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) { in openFragmentedUnicodeString() argument
1368 ut = utext_openUnicodeString(ut, s, status); in openFragmentedUnicodeString()
1370 return ut; in openFragmentedUnicodeString()
1375 memcpy(&fragmentFuncs, ut->pFuncs, sizeof(fragmentFuncs)); in openFragmentedUnicodeString()
1378 ut->pFuncs = &fragmentFuncs; in openFragmentedUnicodeString()
1380 ut->chunkContents = (UChar *)&ut->b; in openFragmentedUnicodeString()
1381 ut->pFuncs->access(ut, 0, TRUE); in openFragmentedUnicodeString()
1382 return ut; in openFragmentedUnicodeString()
1436 UText *ut = utext_openUChars(NULL, s, -1, &status); in Ticket6847() local
1438 utext_setNativeIndex(ut, 0); in Ticket6847()
1441 int64_t nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1443 while ((c = utext_next32(ut)) != U_SENTINEL) { in Ticket6847()
1450 nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1454 nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1456 utext_close(ut); in Ticket6847()
1494 UText *ut = utext_openConstUnicodeString(NULL, &s, &status); in Ticket10983() local
1498 UText *cloned = utext_clone(NULL, ut, TRUE, TRUE, &status); in Ticket10983()
1502 utext_close(ut); in Ticket10983()