Home | History | Annotate | Download | only in intltest

Lines Matching refs:ut

25 UText *openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
165 UText *ut = NULL;
191 ut = utext_openUChars(NULL, buf, -1, &status);
193 TestAccess(sa, ut, cpCount, cpMap);
194 utext_close(ut);
202 ut = utext_openUChars(NULL, buf, saLen, &status);
204 TestAccess(sa, ut, cpCount, cpMap);
205 utext_close(ut);
211 ut = utext_openUnicodeString(NULL, &sa, &status);
213 TestAccess(sa, ut, cpCount, cpMap);
214 TestCMR(sa, ut, cpCount, cpMap, cpMap);
215 utext_close(ut);
220 ut = utext_openConstUnicodeString(NULL, &sa, &status);
222 TestAccess(sa, ut, cpCount, cpMap);
223 utext_close(ut);
228 ut = utext_openReplaceable(NULL, &sa, &status);
230 TestAccess(sa, ut, cpCount, cpMap);
231 TestCMR(sa, ut, cpCount, cpMap, cpMap);
232 utext_close(ut);
239 ut = utext_openCharacterIterator(NULL, ci, &status);
241 TestAccess(sa, ut, cpCount, cpMap);
242 utext_close(ut);
249 ut = openFragmentedUnicodeString(NULL, &sa, &status);
251 TestAccess(sa, ut, cpCount, cpMap);
252 utext_close(ut);
275 ut = utext_openUTF8(NULL, u8String, -1, &status);
277 TestAccess(sa, ut, cpCount, u8Map);
278 utext_close(ut);
289 // ut UText containing the same test text.
297 void UTextTest::TestCMR(const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *u16Map) {
298 TEST_ASSERT(utext_isWritable(ut) == TRUE);
367 TestCopyMove(us, ut, FALSE,
371 TestCopyMove(us, ut, TRUE,
386 TestReplace(us, ut,
404 void UTextTest::TestCopyMove(const UnicodeString &us, UText *ut, UBool move,
417 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status);
461 int64_t expectedNativeLength = utext_nativeLength(ut);
479 UText *ut, // UnicodeText object under test.
495 ut, TRUE, FALSE, &status);
538 expectedNativeLength = utext_nativeLength(ut) + expectedDelta;
551 void UTextTest::TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
553 TestAccessNoClone(us, ut, cpCount, cpMap);
556 utext_setNativeIndex(ut, 0);
558 UText *shallowClone = utext_clone(NULL, ut, FALSE /*deep*/, FALSE /*readOnly*/, &status);
584 void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
592 int64_t utlen = utext_nativeLength(ut);
609 foundIndex = utext_getNativeIndex(ut);
612 foundC = utext_next32(ut);
614 foundIndex = utext_getPreviousNativeIndex(ut);
620 foundC = utext_next32(ut);
624 utext_setNativeIndex(ut, 0);
627 foundIndex = UTEXT_GETNATIVEINDEX(ut);
630 foundC = UTEXT_NEXT32(ut);
636 foundC = UTEXT_NEXT32(ut);
643 len = utext_nativeLength(ut);
644 foundIndex = utext_getNativeIndex(ut);
650 len = utext_getNativeIndex(ut);
651 utext_setNativeIndex(ut, len);
655 int64_t prevIndex = utext_getPreviousNativeIndex(ut);
656 foundC = utext_previous32(ut);
657 foundIndex = utext_getNativeIndex(ut);
670 foundIndex = utext_getNativeIndex(ut);
672 foundIndex = utext_getPreviousNativeIndex(ut);
676 foundC = utext_previous32(ut);
678 foundIndex = utext_getNativeIndex(ut);
680 foundIndex = utext_getPreviousNativeIndex(ut);
685 utext_setNativeIndex(ut, len);
689 foundC = UTEXT_PREVIOUS32(ut);
690 foundIndex = UTEXT_GETNATIVEINDEX(ut);
702 foundIndex = UTEXT_GETNATIVEINDEX(ut);
705 foundC = UTEXT_PREVIOUS32(ut);
707 foundIndex = UTEXT_GETNATIVEINDEX(ut);
721 foundC = utext_next32From(ut, index);
733 foundC = utext_previous32From(ut, index);
746 utext_setNativeIndex(ut, 0);
748 utext_moveIndex32(ut, 1);
749 index = utext_getNativeIndex(ut);
752 index = UTEXT_GETNATIVEINDEX(ut);
757 utext_setNativeIndex(ut, 0);
759 utext_moveIndex32(ut, 2);
760 index = utext_getNativeIndex(ut);
763 index = UTEXT_GETNATIVEINDEX(ut);
769 utext_setNativeIndex(ut, i);
772 index = utext_getNativeIndex(ut);
774 index = UTEXT_GETNATIVEINDEX(ut);
776 utext_moveIndex32(ut, -1);
782 utext_setNativeIndex(ut, i);
785 index = utext_getNativeIndex(ut);
787 index = UTEXT_GETNATIVEINDEX(ut);
789 utext_moveIndex32(ut, -3);
800 len = utext_extract(ut, 0, utlen, buf, bufSize, &status);
807 len = utext_extract(ut, 0, utlen, NULL, 0, &status);
817 len = utext_extract(ut, 0, utlen, buf, 1, &status);
846 UText ut;
847 memset(&ut, 0, sizeof(UText));
848 utext_close(&ut);
855 UText ut = UTEXT_INITIALIZER;
857 UText *ut2 = utext_openUnicodeString(&ut, &s, &status);
859 TEST_ASSERT(ut2 == &ut);
861 UText *ut3 = utext_close(&ut);
862 TEST_ASSERT(ut3 == &ut);
864 UText *ut4 = utext_close(&ut);
865 TEST_ASSERT(ut4 == &ut);
867 utext_openUnicodeString(&ut, &s, &status);
869 utext_close(&ut);
876 UText ut = UTEXT_INITIALIZER;
882 utp = utext_openUnicodeString(&ut, &s1, &status);
884 TEST_ASSERT(utp == &ut);
886 utp = utext_openConstUnicodeString(&ut, &s1, &status);
888 TEST_ASSERT(utp == &ut);
890 utp = utext_openUTF8(&ut, s3, -1, &status);
892 TEST_ASSERT(utp == &ut);
894 utp = utext_openUChars(&ut, s2, -1, &status);
896 TEST_ASSERT(utp == &ut);
898 utp = utext_close(&ut);
899 TEST_ASSERT(utp == &ut);
901 utp = utext_openUnicodeString(&ut, &s1, &status);
903 TEST_ASSERT(utp == &ut);
910 UText ut = UTEXT_INITIALIZER;
912 utext_openUChars(&ut, NULL, 5, &status);
916 utext_openUChars(&ut, NULL, -1, &status);
920 utext_openUTF8(&ut, NULL, 4, &status);
924 utext_openUTF8(&ut, NULL, -1, &status);
934 UText *ut = NULL;
938 ut = utext_openUTF8(NULL, badUTF8, -1, &status);
940 c = utext_char32At(ut, 1);
942 c = utext_char32At(ut, 3);
944 c = utext_char32At(ut, 5);
946 c = utext_char32At(ut, 6);
950 int n = utext_extract(ut, 0, 9, buf, 10, &status);
956 utext_close(ut);
1007 UText *ut = utext_openUTF8(NULL, u8str, -1, &status);
1014 utext_setNativeIndex(ut, i);
1015 int64_t cpIndex = utext_getNativeIndex(ut);
1017 cpIndex = UTEXT_GETNATIVEINDEX(ut);
1023 UChar32 c32 = utext_char32At(ut, i);
1025 int64_t cpIndex = utext_getNativeIndex(ut);
1031 UChar32 c32 = utext_next32From(ut, i);
1033 int64_t cpIndex = utext_getNativeIndex(ut);
1040 UChar32 c32 = utext_previous32From(ut, i);
1042 int64_t cpIndex = utext_getNativeIndex(ut);
1052 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1063 utext_close(ut);
1080 UText *ut = utext_openUnicodeString(NULL, &u16str, &status);
1086 utext_setNativeIndex(ut, i);
1087 int64_t cpIndex = utext_getNativeIndex(ut);
1093 UChar32 c32 = utext_char32At(ut, i);
1095 int64_t cpIndex = utext_getNativeIndex(ut);
1101 UChar32 c32 = utext_next32From(ut, i);
1103 int64_t cpIndex = utext_getNativeIndex(ut);
1109 UChar32 c32 = utext_previous32From(ut, i);
1111 int64_t cpIndex = utext_getNativeIndex(ut);
1121 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1132 utext_close(ut);
1148 UText *ut = utext_openReplaceable(NULL, &u16str, &status);
1154 utext_setNativeIndex(ut, i);
1155 int64_t cpIndex = utext_getNativeIndex(ut);
1161 UChar32 c32 = utext_char32At(ut, i);
1163 int64_t cpIndex = utext_getNativeIndex(ut);
1169 UChar32 c32 = utext_next32From(ut, i);
1171 int64_t cpIndex = utext_getNativeIndex(ut);
1177 UChar32 c32 = utext_previous32From(ut, i);
1179 int64_t cpIndex = utext_getNativeIndex(ut);
1189 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status);
1200 utext_close(ut);
1214 UText *ut = NULL;
1217 ut = utext_openUTF8(ut, u8str, -1, &status);
1219 UBool writable = utext_isWritable(ut);
1221 utext_copy(ut, 1, 2, 0, TRUE, &status);
1225 ut = utext_openUChars(ut, u16str, -1, &status);
1227 writable = utext_isWritable(ut);
1229 utext_copy(ut, 1, 2, 0, TRUE, &status);
1233 ut = utext_openUnicodeString(ut, &ustr, &status);
1235 writable = utext_isWritable(ut);
1237 utext_freeze(ut);
1238 writable = utext_isWritable(ut);
1240 utext_copy(ut, 1, 2, 0, TRUE, &status);
1244 ut = utext_openUnicodeString(ut, &ustr, &status);
1246 ut2 = utext_clone(ut2, ut, FALSE, FALSE, &status); // clone with readonly = false
1250 ut2 = utext_clone(ut2, ut, FALSE, TRUE, &status); // clone with readonly = true
1258 ut = utext_openConstUnicodeString(ut, (const UnicodeString *)&ustr, &status);
1260 writable = utext_isWritable(ut);
1262 utext_copy(ut, 1, 2, 0, TRUE, &status);
1267 ut = utext_openUnicodeString(ut, &ustr, &status);
1269 utext_freeze(ut);
1270 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone
1279 ut = utext_openUChars(ut, u16str, -1, &status);
1281 utext_freeze(ut);
1282 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone
1288 utext_close(ut);
1299 // ut.b the character. Put into both halves.
1304 fragTextAccess(UText *ut, int64_t index, UBool forward) {
1305 const UnicodeString *us = (const UnicodeString *)ut->context;
1310 ut->b = c | c<<16;
1311 ut->chunkOffset = 0;
1312 ut->chunkLength = 1;
1313 ut->chunkNativeStart = index;
1314 ut->chunkNativeLimit = index+1;
1319 ut->b = c | c<<16;
1320 ut->chunkOffset = 1;
1321 ut->chunkLength = 1;
1322 ut->chunkNativeStart = index-1;
1323 ut->chunkNativeLimit = index;
1326 ut->b = 0;
1327 ut->chunkOffset = 0;
1328 ut->chunkLength = 0;
1330 ut->chunkNativeStart = 0;
1331 ut->chunkNativeLimit = 0;
1333 ut->chunkNativeStart = length;
1334 ut->chunkNativeLimit = length;
1365 openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) {
1366 ut = utext_openUnicodeString(ut, s, status);
1368 return ut;
1373 memcpy(&fragmentFuncs, ut->pFuncs, sizeof(fragmentFuncs));
1376 ut->pFuncs = &fragmentFuncs;
1378 ut->chunkContents = (UChar *)&ut->b;
1379 ut->pFuncs->access(ut, 0, TRUE);
1380 return ut;
1434 UText *ut = utext_openUChars(NULL, s, -1, &status);
1436 utext_setNativeIndex(ut, 0);
1439 int64_t nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1441 while ((c = utext_next32(ut)) != U_SENTINEL) {
1448 nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1452 nativeIndex = UTEXT_GETNATIVEINDEX(ut);
1454 utext_close(ut);