Lines Matching refs:ut
30 UText *openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
166 UText *ut = NULL; in TestString() local
192 ut = utext_openUChars(NULL, buf, -1, &status); in TestString()
194 TestAccess(sa, ut, cpCount, cpMap); in TestString()
195 utext_close(ut); in TestString()
203 ut = utext_openUChars(NULL, buf, saLen, &status); in TestString()
205 TestAccess(sa, ut, cpCount, cpMap); in TestString()
206 utext_close(ut); in TestString()
212 ut = utext_openUnicodeString(NULL, &sa, &status); in TestString()
214 TestAccess(sa, ut, cpCount, cpMap); in TestString()
215 TestCMR(sa, ut, cpCount, cpMap, cpMap); in TestString()
216 utext_close(ut); in TestString()
221 ut = utext_openConstUnicodeString(NULL, &sa, &status); in TestString()
223 TestAccess(sa, ut, cpCount, cpMap); in TestString()
224 utext_close(ut); in TestString()
229 ut = utext_openReplaceable(NULL, &sa, &status); in TestString()
231 TestAccess(sa, ut, cpCount, cpMap); in TestString()
232 TestCMR(sa, ut, cpCount, cpMap, cpMap); in TestString()
233 utext_close(ut); in TestString()
240 ut = utext_openCharacterIterator(NULL, ci, &status); in TestString()
242 TestAccess(sa, ut, cpCount, cpMap); in TestString()
243 utext_close(ut); in TestString()
250 ut = openFragmentedUnicodeString(NULL, &sa, &status); in TestString()
252 TestAccess(sa, ut, cpCount, cpMap); in TestString()
253 utext_close(ut); in TestString()
276 ut = utext_openUTF8(NULL, u8String, -1, &status); in TestString()
278 TestAccess(sa, ut, cpCount, u8Map); in TestString()
279 utext_close(ut); in TestString()
298 void UTextTest::TestCMR(const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *u16Map) { in TestCMR() argument
299 TEST_ASSERT(utext_isWritable(ut) == TRUE); in TestCMR()
368 TestCopyMove(us, ut, FALSE, in TestCMR()
372 TestCopyMove(us, ut, TRUE, in TestCMR()
387 TestReplace(us, ut, in TestCMR()
405 void UTextTest::TestCopyMove(const UnicodeString &us, UText *ut, UBool move, in TestCopyMove() argument
418 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status); in TestCopyMove()
462 int64_t expectedNativeLength = utext_nativeLength(ut); in TestCopyMove()
480 UText *ut, // UnicodeText object under test. in TestReplace() argument
496 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status); in TestReplace()
539 expectedNativeLength = utext_nativeLength(ut) + expectedDelta; in TestReplace()
552 void UTextTest::TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) { in TestAccess() argument
554 TestAccessNoClone(us, ut, cpCount, cpMap); in TestAccess()
557 utext_setNativeIndex(ut, 0); in TestAccess()
559 UText *shallowClone = utext_clone(NULL, ut, FALSE /*deep*/, FALSE /*readOnly*/, &status); in TestAccess()
585 void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) { in TestAccessNoClone() argument
593 int64_t utlen = utext_nativeLength(ut); in TestAccessNoClone()
610 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
613 foundC = utext_next32(ut); in TestAccessNoClone()
615 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
621 foundC = utext_next32(ut); in TestAccessNoClone()
625 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
628 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
631 foundC = UTEXT_NEXT32(ut); in TestAccessNoClone()
637 foundC = UTEXT_NEXT32(ut); in TestAccessNoClone()
644 len = utext_nativeLength(ut); in TestAccessNoClone()
645 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
651 len = utext_getNativeIndex(ut); in TestAccessNoClone()
652 utext_setNativeIndex(ut, len); in TestAccessNoClone()
656 int64_t prevIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
657 foundC = utext_previous32(ut); in TestAccessNoClone()
658 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
671 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
673 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
677 foundC = utext_previous32(ut); in TestAccessNoClone()
679 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
681 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
686 utext_setNativeIndex(ut, len); in TestAccessNoClone()
690 foundC = UTEXT_PREVIOUS32(ut); in TestAccessNoClone()
691 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
703 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
706 foundC = UTEXT_PREVIOUS32(ut); in TestAccessNoClone()
708 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
722 foundC = utext_next32From(ut, index); in TestAccessNoClone()
734 foundC = utext_previous32From(ut, index); in TestAccessNoClone()
747 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
749 utext_moveIndex32(ut, 1); in TestAccessNoClone()
750 index = utext_getNativeIndex(ut); in TestAccessNoClone()
753 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
758 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
760 utext_moveIndex32(ut, 2); in TestAccessNoClone()
761 index = utext_getNativeIndex(ut); in TestAccessNoClone()
764 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
770 utext_setNativeIndex(ut, i); in TestAccessNoClone()
773 index = utext_getNativeIndex(ut); in TestAccessNoClone()
775 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
777 utext_moveIndex32(ut, -1); in TestAccessNoClone()
783 utext_setNativeIndex(ut, i); in TestAccessNoClone()
786 index = utext_getNativeIndex(ut); in TestAccessNoClone()
788 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
790 utext_moveIndex32(ut, -3); in TestAccessNoClone()
801 len = utext_extract(ut, 0, utlen, buf, bufSize, &status); in TestAccessNoClone()
808 len = utext_extract(ut, 0, utlen, NULL, 0, &status); in TestAccessNoClone()
818 len = utext_extract(ut, 0, utlen, buf, 1, &status); in TestAccessNoClone()
847 UText ut; in ErrorTest() local
848 memset(&ut, 0, sizeof(UText)); in ErrorTest()
849 utext_close(&ut); in ErrorTest()
856 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
858 UText *ut2 = utext_openUnicodeString(&ut, &s, &status); in ErrorTest()
860 TEST_ASSERT(ut2 == &ut); in ErrorTest()
862 UText *ut3 = utext_close(&ut); in ErrorTest()
863 TEST_ASSERT(ut3 == &ut); in ErrorTest()
865 UText *ut4 = utext_close(&ut); in ErrorTest()
866 TEST_ASSERT(ut4 == &ut); in ErrorTest()
868 utext_openUnicodeString(&ut, &s, &status); in ErrorTest()
870 utext_close(&ut); in ErrorTest()
877 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
883 utp = utext_openUnicodeString(&ut, &s1, &status); in ErrorTest()
885 TEST_ASSERT(utp == &ut); in ErrorTest()
887 utp = utext_openConstUnicodeString(&ut, &s1, &status); in ErrorTest()
889 TEST_ASSERT(utp == &ut); in ErrorTest()
891 utp = utext_openUTF8(&ut, s3, -1, &status); in ErrorTest()
893 TEST_ASSERT(utp == &ut); in ErrorTest()
895 utp = utext_openUChars(&ut, s2, -1, &status); in ErrorTest()
897 TEST_ASSERT(utp == &ut); in ErrorTest()
899 utp = utext_close(&ut); in ErrorTest()
900 TEST_ASSERT(utp == &ut); in ErrorTest()
902 utp = utext_openUnicodeString(&ut, &s1, &status); in ErrorTest()
904 TEST_ASSERT(utp == &ut); in ErrorTest()
911 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
913 utext_openUChars(&ut, NULL, 5, &status); in ErrorTest()
917 utext_openUChars(&ut, NULL, -1, &status); in ErrorTest()
921 utext_openUTF8(&ut, NULL, 4, &status); in ErrorTest()
925 utext_openUTF8(&ut, NULL, -1, &status); in ErrorTest()
935 UText *ut = NULL; in ErrorTest() local
939 ut = utext_openUTF8(NULL, badUTF8, -1, &status); in ErrorTest()
941 c = utext_char32At(ut, 1); in ErrorTest()
943 c = utext_char32At(ut, 3); in ErrorTest()
945 c = utext_char32At(ut, 5); in ErrorTest()
947 c = utext_char32At(ut, 6); in ErrorTest()
951 int n = utext_extract(ut, 0, 9, buf, 10, &status); in ErrorTest()
961 utext_close(ut); in ErrorTest()
1012 UText *ut = utext_openUTF8(NULL, u8str, -1, &status); in ErrorTest() local
1019 utext_setNativeIndex(ut, i); in ErrorTest()
1020 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1022 cpIndex = UTEXT_GETNATIVEINDEX(ut); in ErrorTest()
1028 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1030 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1036 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1038 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1045 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1047 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1057 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1068 utext_close(ut); in ErrorTest()
1085 UText *ut = utext_openUnicodeString(NULL, &u16str, &status); in ErrorTest() local
1091 utext_setNativeIndex(ut, i); in ErrorTest()
1092 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1098 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1100 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1106 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1108 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1114 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1116 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1126 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1137 utext_close(ut); in ErrorTest()
1153 UText *ut = utext_openReplaceable(NULL, &u16str, &status); in ErrorTest() local
1159 utext_setNativeIndex(ut, i); in ErrorTest()
1160 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1166 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1168 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1174 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1176 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1182 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1184 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1194 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1205 utext_close(ut); in ErrorTest()
1219 UText *ut = NULL; in FreezeTest() local
1222 ut = utext_openUTF8(ut, u8str, -1, &status); in FreezeTest()
1224 UBool writable = utext_isWritable(ut); in FreezeTest()
1226 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1230 ut = utext_openUChars(ut, u16str, -1, &status); in FreezeTest()
1232 writable = utext_isWritable(ut); in FreezeTest()
1234 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1238 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1240 writable = utext_isWritable(ut); in FreezeTest()
1242 utext_freeze(ut); in FreezeTest()
1243 writable = utext_isWritable(ut); in FreezeTest()
1245 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1249 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1251 ut2 = utext_clone(ut2, ut, FALSE, FALSE, &status); // clone with readonly = false in FreezeTest()
1255 ut2 = utext_clone(ut2, ut, FALSE, TRUE, &status); // clone with readonly = true in FreezeTest()
1263 ut = utext_openConstUnicodeString(ut, (const UnicodeString *)&ustr, &status); in FreezeTest()
1265 writable = utext_isWritable(ut); in FreezeTest()
1267 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1272 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1274 utext_freeze(ut); in FreezeTest()
1275 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone in FreezeTest()
1284 ut = utext_openUChars(ut, u16str, -1, &status); in FreezeTest()
1286 utext_freeze(ut); in FreezeTest()
1287 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone in FreezeTest()
1293 utext_close(ut); in FreezeTest()
1309 fragTextAccess(UText *ut, int64_t index, UBool forward) { in fragTextAccess() argument
1310 const UnicodeString *us = (const UnicodeString *)ut->context; in fragTextAccess()
1315 ut->b = c | c<<16; in fragTextAccess()
1316 ut->chunkOffset = 0; in fragTextAccess()
1317 ut->chunkLength = 1; in fragTextAccess()
1318 ut->chunkNativeStart = index; in fragTextAccess()
1319 ut->chunkNativeLimit = index+1; in fragTextAccess()
1324 ut->b = c | c<<16; in fragTextAccess()
1325 ut->chunkOffset = 1; in fragTextAccess()
1326 ut->chunkLength = 1; in fragTextAccess()
1327 ut->chunkNativeStart = index-1; in fragTextAccess()
1328 ut->chunkNativeLimit = index; in fragTextAccess()
1331 ut->b = 0; in fragTextAccess()
1332 ut->chunkOffset = 0; in fragTextAccess()
1333 ut->chunkLength = 0; in fragTextAccess()
1335 ut->chunkNativeStart = 0; in fragTextAccess()
1336 ut->chunkNativeLimit = 0; in fragTextAccess()
1338 ut->chunkNativeStart = length; in fragTextAccess()
1339 ut->chunkNativeLimit = length; in fragTextAccess()
1370 openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) { in openFragmentedUnicodeString() argument
1371 ut = utext_openUnicodeString(ut, s, status); in openFragmentedUnicodeString()
1373 return ut; in openFragmentedUnicodeString()
1378 memcpy(&fragmentFuncs, ut->pFuncs, sizeof(fragmentFuncs)); in openFragmentedUnicodeString()
1381 ut->pFuncs = &fragmentFuncs; in openFragmentedUnicodeString()
1383 ut->chunkContents = (UChar *)&ut->b; in openFragmentedUnicodeString()
1384 ut->pFuncs->access(ut, 0, TRUE); in openFragmentedUnicodeString()
1385 return ut; in openFragmentedUnicodeString()
1439 UText *ut = utext_openUChars(NULL, s, -1, &status); in Ticket6847() local
1441 utext_setNativeIndex(ut, 0); in Ticket6847()
1444 int64_t nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1446 while ((c = utext_next32(ut)) != U_SENTINEL) { in Ticket6847()
1453 nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1457 nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1459 utext_close(ut); in Ticket6847()
1497 UText *ut = utext_openConstUnicodeString(NULL, &s, &status); in Ticket10983() local
1501 UText *cloned = utext_clone(NULL, ut, TRUE, TRUE, &status); in Ticket10983()
1505 utext_close(ut); in Ticket10983()
1528 UText ut = UTEXT_INITIALIZER; in Ticket12130() local
1529 utext_openUChars(&ut, ustr, -1, &status); in Ticket12130()
1536 utext_extract(&ut, startIdx, endIdx, extractBuffer, UPRV_LENGTHOF(extractBuffer), &status); in Ticket12130()
1541 int64_t ni = utext_getNativeIndex(&ut); in Ticket12130()
1554 utext_close(&ut); in Ticket12130()
1559 utext_openUChars(&ut, ustr, str.length(), &status); in Ticket12130()
1563 utext_extract(&ut, startIdx, endIdx, extractBuffer, UPRV_LENGTHOF(extractBuffer), &status); in Ticket12130()
1568 int64_t ni = utext_getNativeIndex(&ut); in Ticket12130()
1581 utext_close(&ut); in Ticket12130()
1590 LocalUTextPointer ut(utext_openUChars(NULL, str, -1, &status)); in Ticket13344() local
1593 UTEXT_SETNATIVEINDEX(ut.getAlias(), 3); in Ticket13344()
1594 assertEquals("UTextTest::Ticket13344-lead", (int64_t)3, utext_getNativeIndex(ut.getAlias())); in Ticket13344()
1595 UTEXT_SETNATIVEINDEX(ut.getAlias(), 4); in Ticket13344()
1596 assertEquals("UTextTest::Ticket13344-trail", (int64_t)3, utext_getNativeIndex(ut.getAlias())); in Ticket13344()
1597 UTEXT_SETNATIVEINDEX(ut.getAlias(), 5); in Ticket13344()
1598 assertEquals("UTextTest::Ticket13344-bmp", (int64_t)5, utext_getNativeIndex(ut.getAlias())); in Ticket13344()
1600 utext_setNativeIndex(ut.getAlias(), 3); in Ticket13344()
1601 assertEquals("UTextTest::Ticket13344-lead-2", (int64_t)3, utext_getNativeIndex(ut.getAlias())); in Ticket13344()
1602 utext_setNativeIndex(ut.getAlias(), 4); in Ticket13344()
1603 assertEquals("UTextTest::Ticket13344-trail-2", (int64_t)3, utext_getNativeIndex(ut.getAlias())); in Ticket13344()
1604 utext_setNativeIndex(ut.getAlias(), 5); in Ticket13344()
1605 assertEquals("UTextTest::Ticket13344-bmp-2", (int64_t)5, utext_getNativeIndex(ut.getAlias())); in Ticket13344()