Home | History | Annotate | Download | only in intltest

Lines Matching defs:ut

29 UText *openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
173 UText *ut = NULL;
199 ut = utext_openUChars(NULL, buf, -1, &status);
201 TestAccess(sa, ut, cpCount, cpMap);
202 utext_close(ut);
210 ut = utext_openUChars(NULL, buf, saLen, &status);
212 TestAccess(sa, ut, cpCount, cpMap);
213 utext_close(ut);
219 ut = utext_openUnicodeString(NULL, &sa, &status);
221 TestAccess(sa, ut, cpCount, cpMap);
222 TestCMR(sa, ut, cpCount, cpMap, cpMap);
223 utext_close(ut);
228 ut = utext_openConstUnicodeString(NULL, &sa, &status);
230 TestAccess(sa, ut, cpCount, cpMap);
231 utext_close(ut);
236 ut = utext_openReplaceable(NULL, &sa, &status);
238 TestAccess(sa, ut, cpCount, cpMap);
239 TestCMR(sa, ut, cpCount, cpMap, cpMap);
240 utext_close(ut);
247 ut = utext_openCharacterIterator(NULL, ci, &status);
249 TestAccess(sa, ut, cpCount, cpMap);
250 utext_close(ut);
257 ut = openFragmentedUnicodeString(NULL, &sa, &status);
259 TestAccess(sa, ut, cpCount, cpMap);
260 utext_close(ut);
283 ut = utext_openUTF8(NULL, u8String, -1, &status);
285 TestAccess(sa, ut, cpCount, u8Map);
286 utext_close(ut);
297 // ut UText containing the same test text.
305 void UTextTest::TestCMR(const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *u16Map) {
306 TEST_ASSERT(utext_isWritable(ut) == TRUE);
375 TestCopyMove(us, ut, FALSE,
379 TestCopyMove(us, ut, TRUE,
394 TestReplace(us, ut,
412 void UTextTest::TestCopyMove(const UnicodeString &us, UText *ut, UBool move,
425 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status);
469 int64_t expectedNativeLength = utext_nativeLength(ut);
487 UText *ut, // UnicodeText object under test.
503 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status);
546 expectedNativeLength = utext_nativeLength(ut) + expectedDelta;
559 void UTextTest::TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
561 TestAccessNoClone(us, ut, cpCount, cpMap);
564 utext_setNativeIndex(ut, 0);
566 UText *shallowClone = utext_clone(NULL, ut, FALSE /*deep*/, FALSE /*readOnly*/, &status);
592 void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
600 int64_t utlen = utext_nativeLength(ut);
617 foundIndex = utext_getNativeIndex(ut);
620 foundC = utext_next32(ut);
622 foundIndex = utext_getPreviousNativeIndex(ut);
628 foundC = utext_next32(ut);
632 utext_setNativeIndex(ut, 0);
635 foundIndex = UTEXT_GETNATIVEINDEX(ut);
638 foundC = UTEXT_NEXT32(ut);
644 foundC = UTEXT_NEXT32(ut);
651 len = utext_nativeLength(ut);
652 foundIndex = utext_getNativeIndex(ut);
658 len = utext_getNativeIndex(ut);
659 utext_setNativeIndex(ut, len);
663 int64_t prevIndex = utext_getPreviousNativeIndex(ut);
664 foundC = utext_previous32(ut);
665 foundIndex = utext_getNativeIndex(ut);
678 foundIndex = utext_getNativeIndex(ut);
680 foundIndex = utext_getPreviousNativeIndex(ut);
684 foundC = utext_previous32(ut);
686 foundIndex = utext_getNativeIndex(ut);
688 foundIndex = utext_getPreviousNativeIndex(ut);
693 utext_setNativeIndex(ut, len);
697 foundC = UTEXT_PREVIOUS32(ut);
698 foundIndex = UTEXT_GETNATIVEINDEX(ut);
710 foundIndex = UTEXT_GETNATIVEINDEX(ut);
713 foundC = UTEXT_PREVIOUS32(ut);
715 foundIndex = UTEXT_GETNATIVEINDEX(ut);
729 foundC = utext_next32From(ut, index);
741 foundC = utext_previous32From(ut, index);
754 utext_setNativeIndex(ut, 0);
756 utext_moveIndex32(ut, 1);
757 index = utext_getNativeIndex(ut);
760 index = UTEXT_GETNATIVEINDEX(ut);
765 utext_setNativeIndex(ut, 0);
767 utext_moveIndex32(ut, 2);
768 index = utext_getNativeIndex(ut);
771 index = UTEXT_GETNATIVEINDEX(ut);
777 utext_setNativeIndex(ut, i);
780 index = utext_getNativeIndex(ut);
782 index = UTEXT_GETNATIVEINDEX(ut);
784 utext_moveIndex32(ut, -1);
790 utext_setNativeIndex(ut, i);
793 index = utext_getNativeIndex(ut);
795 index = UTEXT_GETNATIVEINDEX(ut);
797 utext_moveIndex32(ut, -3);
808 len = utext_extract(ut, 0, utlen, buf, bufSize, &status);
815 len = utext_extract(ut, 0, utlen, NULL, 0, &status);
825 len = utext_extract(ut, 0, utlen, buf, 1, &status);
854 UText ut;
855 memset(&ut, 0, sizeof(UText));
856 utext_close(&ut);
863 UText ut = UTEXT_INITIALIZER;
865 UText *ut2 = utext_openUnicodeString(&ut, &s, &status);
867 TEST_ASSERT(ut2 == &ut);
869 UText *ut3 = utext_close(&ut);
870 TEST_ASSERT(ut3 == &ut);
872 UText *ut4 = utext_close(&ut);
873 TEST_ASSERT(ut4 == &ut);
875 utext_openUnicodeString(&ut, &s, &status);
877 utext_close(&ut);
884 UText ut = UTEXT_INITIALIZER;
890 utp = utext_openUnicodeString(&ut, &s1, &status);
892 TEST_ASSERT(utp == &ut);
894 utp = utext_openConstUnicodeString(&ut, &s1, &status);
896 TEST_ASSERT(utp == &ut);
898 utp = utext_openUTF8(&ut, s3, -1, &status);
900 TEST_ASSERT(utp == &ut);
902 utp = utext_openUChars(&ut, s2, -1, &status);
904 TEST_ASSERT(utp == &ut);
906 utp = utext_close(&ut);
907 TEST_ASSERT(utp == &ut);
909 utp = utext_openUnicodeString(&ut, &s1, &status);
911 TEST_ASSERT(utp == &ut);
918 UText ut = UTEXT_INITIALIZER;
920 utext_openUChars(&ut, NULL, 5, &status);
924 utext_openUChars(&ut, NULL, -1, &status);
928 utext_openUTF8(&ut, NULL, 4, &status);
932 utext_openUTF8(&ut, NULL, -1, &status);
942 UText *ut = NULL;
946 ut = utext_openUTF8(NULL, badUTF8, -1, &status);
948 c = utext_char32At(ut, 1);
950 c = utext_char32At(ut, 3);
952 c = utext_char32At(ut, 5);
954 c = utext_char32At(ut, 6);
958 int n = utext_extract(ut, 0, 9, buf, 10, &status);
964 utext_close(ut);
1015 UText *ut = utext_openUTF8(NULL, u8str, -1, &status);
1022 utext_setNativeIndex(ut, i);
1023 int64_t cpIndex = utext_getNativeIndex(ut);
1025 cpIndex = UTEXT_GETNATIVEINDEX(ut);
1031 UChar32 c32 = utext_char32At(ut, i);
1033 int64_t cpIndex = utext_getNativeIndex(ut);
1039 UChar32 c32 = utext_next32From(ut, i);
1041 int64_t cpIndex = utext_getNativeIndex(ut);
1048 UChar32 c32 = utext_previous32From(ut, i);
1050 int64_t cpIndex = utext_getNativeIndex(ut);
1060 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1071 utext_close(ut);
1088 UText *ut = utext_openUnicodeString(NULL, &u16str, &status);
1094 utext_setNativeIndex(ut, i);
1095 int64_t cpIndex = utext_getNativeIndex(ut);
1101 UChar32 c32 = utext_char32At(ut, i);
1103 int64_t cpIndex = utext_getNativeIndex(ut);
1109 UChar32 c32 = utext_next32From(ut, i);
1111 int64_t cpIndex = utext_getNativeIndex(ut);
1117 UChar32 c32 = utext_previous32From(ut, i);
1119 int64_t cpIndex = utext_getNativeIndex(ut);
1129 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1140 utext_close(ut);
1156 UText *ut = utext_openReplaceable(NULL, &u16str, &status);
1162 utext_setNativeIndex(ut, i);
1163 int64_t cpIndex = utext_getNativeIndex(ut);
1169 UChar32 c32 = utext_char32At(ut, i);
1171 int64_t cpIndex = utext_getNativeIndex(ut);
1177 UChar32 c32 = utext_next32From(ut, i);
1179 int64_t cpIndex = utext_getNativeIndex(ut);
1185 UChar32 c32 = utext_previous32From(ut, i);
1187 int64_t cpIndex = utext_getNativeIndex(ut);
1197 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1208 utext_close(ut);
1222 UText *ut = NULL;
1225 ut = utext_openUTF8(ut, u8str, -1, &status);
1227 UBool writable = utext_isWritable(ut);
1229 utext_copy(ut, 1, 2, 0, TRUE, &status);
1233 ut = utext_openUChars(ut, u16str, -1, &status);
1235 writable = utext_isWritable(ut);
1237 utext_copy(ut, 1, 2, 0, TRUE, &status);
1241 ut = utext_openUnicodeString(ut, &ustr, &status);
1243 writable = utext_isWritable(ut);
1245 utext_freeze(ut);
1246 writable = utext_isWritable(ut);
1248 utext_copy(ut, 1, 2, 0, TRUE, &status);
1252 ut = utext_openUnicodeString(ut, &ustr, &status);
1254 ut2 = utext_clone(ut2, ut, FALSE, FALSE, &status); // clone with readonly = false
1258 ut2 = utext_clone(ut2, ut, FALSE, TRUE, &status); // clone with readonly = true
1266 ut = utext_openConstUnicodeString(ut, (const UnicodeString *)&ustr, &status);
1268 writable = utext_isWritable(ut);
1270 utext_copy(ut, 1, 2, 0, TRUE, &status);
1275 ut = utext_openUnicodeString(ut, &ustr, &status);
1277 utext_freeze(ut);
1278 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone
1287 ut = utext_openUChars(ut, u16str, -1, &status);
1289 utext_freeze(ut);
1290 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone
1296 utext_close(ut);
1307 // ut.b the character. Put into both halves.
1312 fragTextAccess(UText *ut, int64_t index, UBool forward) {
1313 const UnicodeString *us = (const UnicodeString *)ut->context;
1318 ut->b = c | c<<16;
1319 ut->chunkOffset = 0;
1320 ut->chunkLength = 1;
1321 ut->chunkNativeStart = index;
1322 ut->chunkNativeLimit = index+1;
1327 ut->b = c | c<<16;
1328 ut->chunkOffset = 1;
1329 ut->chunkLength = 1;
1330 ut->chunkNativeStart = index-1;
1331 ut->chunkNativeLimit = index;
1334 ut->b = 0;
1335 ut->chunkOffset = 0;
1336 ut->chunkLength = 0;
1338 ut->chunkNativeStart = 0;
1339 ut->chunkNativeLimit = 0;
1341 ut->chunkNativeStart = length;
1342 ut->chunkNativeLimit = length;
1373 openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) {
1374 ut = utext_openUnicodeString(ut, s, status);
1376 return ut;
1381 memcpy(&fragmentFuncs, ut->pFuncs, sizeof(fragmentFuncs));
1384 ut->pFuncs = &fragmentFuncs;
1386 ut->chunkContents = (UChar *)&ut->b;
1387 ut->pFuncs->access(ut, 0, TRUE);
1388 return ut;
1442 UText *ut = utext_openUChars(NULL, s, -1, &status);
1444 utext_setNativeIndex(ut, 0);
1447 int64_t nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1449 while ((c = utext_next32(ut)) != U_SENTINEL) {
1456 nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1460 nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1462 utext_close(ut);
1500 UText *ut = utext_openConstUnicodeString(NULL, &s, &status);
1504 UText *cloned = utext_clone(NULL, ut, TRUE, TRUE, &status);
1508 utext_close(ut);
1531 UText ut = UTEXT_INITIALIZER;
1532 utext_openUChars(&ut, ustr, -1, &status);
1539 utext_extract(&ut, startIdx, endIdx, extractBuffer, UPRV_LENGTHOF(extractBuffer), &status);
1544 int64_t ni = utext_getNativeIndex(&ut);
1557 utext_close(&ut);
1562 utext_openUChars(&ut, ustr, str.length(), &status);
1566 utext_extract(&ut, startIdx, endIdx, extractBuffer, UPRV_LENGTHOF(extractBuffer), &status);
1571 int64_t ni = utext_getNativeIndex(&ut);
1584 utext_close(&ut);