Lines Matching refs:ut
25 UText *openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
165 UText *ut = NULL; in TestString() local
191 ut = utext_openUChars(NULL, buf, -1, &status); in TestString()
193 TestAccess(sa, ut, cpCount, cpMap); in TestString()
194 utext_close(ut); in TestString()
202 ut = utext_openUChars(NULL, buf, saLen, &status); in TestString()
204 TestAccess(sa, ut, cpCount, cpMap); in TestString()
205 utext_close(ut); in TestString()
211 ut = utext_openUnicodeString(NULL, &sa, &status); in TestString()
213 TestAccess(sa, ut, cpCount, cpMap); in TestString()
214 TestCMR(sa, ut, cpCount, cpMap, cpMap); in TestString()
215 utext_close(ut); in TestString()
220 ut = utext_openConstUnicodeString(NULL, &sa, &status); in TestString()
222 TestAccess(sa, ut, cpCount, cpMap); in TestString()
223 utext_close(ut); in TestString()
228 ut = utext_openReplaceable(NULL, &sa, &status); in TestString()
230 TestAccess(sa, ut, cpCount, cpMap); in TestString()
231 TestCMR(sa, ut, cpCount, cpMap, cpMap); in TestString()
232 utext_close(ut); in TestString()
239 ut = utext_openCharacterIterator(NULL, ci, &status); in TestString()
241 TestAccess(sa, ut, cpCount, cpMap); in TestString()
242 utext_close(ut); in TestString()
249 ut = openFragmentedUnicodeString(NULL, &sa, &status); in TestString()
251 TestAccess(sa, ut, cpCount, cpMap); in TestString()
252 utext_close(ut); in TestString()
275 ut = utext_openUTF8(NULL, u8String, -1, &status); in TestString()
277 TestAccess(sa, ut, cpCount, u8Map); in TestString()
278 utext_close(ut); in TestString()
297 void UTextTest::TestCMR(const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *u16Map) { in TestCMR() argument
298 TEST_ASSERT(utext_isWritable(ut) == TRUE); in TestCMR()
367 TestCopyMove(us, ut, FALSE, in TestCMR()
371 TestCopyMove(us, ut, TRUE, in TestCMR()
386 TestReplace(us, ut, in TestCMR()
404 void UTextTest::TestCopyMove(const UnicodeString &us, UText *ut, UBool move, in TestCopyMove() argument
417 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status); in TestCopyMove()
461 int64_t expectedNativeLength = utext_nativeLength(ut); in TestCopyMove()
479 UText *ut, // UnicodeText object under test. in TestReplace() argument
495 targetUT = utext_clone(NULL, ut, TRUE, FALSE, &status); in TestReplace()
538 expectedNativeLength = utext_nativeLength(ut) + expectedDelta; in TestReplace()
551 void UTextTest::TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) { in TestAccess() argument
553 TestAccessNoClone(us, ut, cpCount, cpMap); in TestAccess()
556 utext_setNativeIndex(ut, 0); in TestAccess()
558 UText *shallowClone = utext_clone(NULL, ut, FALSE /*deep*/, FALSE /*readOnly*/, &status); in TestAccess()
584 void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) { in TestAccessNoClone() argument
592 int64_t utlen = utext_nativeLength(ut); in TestAccessNoClone()
609 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
612 foundC = utext_next32(ut); in TestAccessNoClone()
614 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
620 foundC = utext_next32(ut); in TestAccessNoClone()
624 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
627 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
630 foundC = UTEXT_NEXT32(ut); in TestAccessNoClone()
636 foundC = UTEXT_NEXT32(ut); in TestAccessNoClone()
643 len = utext_nativeLength(ut); in TestAccessNoClone()
644 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
650 len = utext_getNativeIndex(ut); in TestAccessNoClone()
651 utext_setNativeIndex(ut, len); in TestAccessNoClone()
655 int64_t prevIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
656 foundC = utext_previous32(ut); in TestAccessNoClone()
657 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
670 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
672 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
676 foundC = utext_previous32(ut); in TestAccessNoClone()
678 foundIndex = utext_getNativeIndex(ut); in TestAccessNoClone()
680 foundIndex = utext_getPreviousNativeIndex(ut); in TestAccessNoClone()
685 utext_setNativeIndex(ut, len); in TestAccessNoClone()
689 foundC = UTEXT_PREVIOUS32(ut); in TestAccessNoClone()
690 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
702 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
705 foundC = UTEXT_PREVIOUS32(ut); in TestAccessNoClone()
707 foundIndex = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
721 foundC = utext_next32From(ut, index); in TestAccessNoClone()
733 foundC = utext_previous32From(ut, index); in TestAccessNoClone()
746 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
748 utext_moveIndex32(ut, 1); in TestAccessNoClone()
749 index = utext_getNativeIndex(ut); in TestAccessNoClone()
752 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
757 utext_setNativeIndex(ut, 0); in TestAccessNoClone()
759 utext_moveIndex32(ut, 2); in TestAccessNoClone()
760 index = utext_getNativeIndex(ut); in TestAccessNoClone()
763 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
769 utext_setNativeIndex(ut, i); in TestAccessNoClone()
772 index = utext_getNativeIndex(ut); in TestAccessNoClone()
774 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
776 utext_moveIndex32(ut, -1); in TestAccessNoClone()
782 utext_setNativeIndex(ut, i); in TestAccessNoClone()
785 index = utext_getNativeIndex(ut); in TestAccessNoClone()
787 index = UTEXT_GETNATIVEINDEX(ut); in TestAccessNoClone()
789 utext_moveIndex32(ut, -3); in TestAccessNoClone()
800 len = utext_extract(ut, 0, utlen, buf, bufSize, &status); in TestAccessNoClone()
807 len = utext_extract(ut, 0, utlen, NULL, 0, &status); in TestAccessNoClone()
817 len = utext_extract(ut, 0, utlen, buf, 1, &status); in TestAccessNoClone()
1320 UText ut; in ErrorTest() local
1321 memset(&ut, 0, sizeof(UText)); in ErrorTest()
1322 utext_close(&ut); in ErrorTest()
1329 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
1331 UText *ut2 = utext_openUnicodeString(&ut, &s, &status); in ErrorTest()
1333 TEST_ASSERT(ut2 == &ut); in ErrorTest()
1335 UText *ut3 = utext_close(&ut); in ErrorTest()
1336 TEST_ASSERT(ut3 == &ut); in ErrorTest()
1338 UText *ut4 = utext_close(&ut); in ErrorTest()
1339 TEST_ASSERT(ut4 == &ut); in ErrorTest()
1341 utext_openUnicodeString(&ut, &s, &status); in ErrorTest()
1343 utext_close(&ut); in ErrorTest()
1350 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
1356 utp = utext_openUnicodeString(&ut, &s1, &status); in ErrorTest()
1358 TEST_ASSERT(utp == &ut); in ErrorTest()
1360 utp = utext_openConstUnicodeString(&ut, &s1, &status); in ErrorTest()
1362 TEST_ASSERT(utp == &ut); in ErrorTest()
1364 utp = utext_openUTF8(&ut, s3, -1, &status); in ErrorTest()
1366 TEST_ASSERT(utp == &ut); in ErrorTest()
1368 utp = utext_openUChars(&ut, s2, -1, &status); in ErrorTest()
1370 TEST_ASSERT(utp == &ut); in ErrorTest()
1372 utp = utext_close(&ut); in ErrorTest()
1373 TEST_ASSERT(utp == &ut); in ErrorTest()
1375 utp = utext_openUnicodeString(&ut, &s1, &status); in ErrorTest()
1377 TEST_ASSERT(utp == &ut); in ErrorTest()
1384 UText ut = UTEXT_INITIALIZER; in ErrorTest() local
1386 utext_openUChars(&ut, NULL, 5, &status); in ErrorTest()
1390 utext_openUChars(&ut, NULL, -1, &status); in ErrorTest()
1394 utext_openUTF8(&ut, NULL, 4, &status); in ErrorTest()
1398 utext_openUTF8(&ut, NULL, -1, &status); in ErrorTest()
1408 UText *ut = NULL; in ErrorTest() local
1412 ut = utext_openUTF8(NULL, badUTF8, -1, &status); in ErrorTest()
1414 c = utext_char32At(ut, 1); in ErrorTest()
1416 c = utext_char32At(ut, 3); in ErrorTest()
1418 c = utext_char32At(ut, 5); in ErrorTest()
1420 c = utext_char32At(ut, 6); in ErrorTest()
1424 int n = utext_extract(ut, 0, 9, buf, 10, &status); in ErrorTest()
1430 utext_close(ut); in ErrorTest()
1481 UText *ut = utext_openUTF8(NULL, u8str, -1, &status); in ErrorTest() local
1488 utext_setNativeIndex(ut, i); in ErrorTest()
1489 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1491 cpIndex = UTEXT_GETNATIVEINDEX(ut); in ErrorTest()
1497 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1499 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1505 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1507 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1514 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1516 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1526 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1537 utext_close(ut); in ErrorTest()
1554 UText *ut = utext_openUnicodeString(NULL, &u16str, &status); in ErrorTest() local
1560 utext_setNativeIndex(ut, i); in ErrorTest()
1561 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1567 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1569 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1575 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1577 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1583 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1585 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1595 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1606 utext_close(ut); in ErrorTest()
1622 UText *ut = utext_openReplaceable(NULL, &u16str, &status); in ErrorTest() local
1628 utext_setNativeIndex(ut, i); in ErrorTest()
1629 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1635 UChar32 c32 = utext_char32At(ut, i); in ErrorTest()
1637 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1643 UChar32 c32 = utext_next32From(ut, i); in ErrorTest()
1645 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1651 UChar32 c32 = utext_previous32From(ut, i); in ErrorTest()
1653 int64_t cpIndex = utext_getNativeIndex(ut); in ErrorTest()
1663 int32_t extractedLen = utext_extract(ut, i, i+1, buf, 3, &status); in ErrorTest()
1674 utext_close(ut); in ErrorTest()
1688 UText *ut = NULL; in FreezeTest() local
1691 ut = utext_openUTF8(ut, u8str, -1, &status); in FreezeTest()
1693 UBool writable = utext_isWritable(ut); in FreezeTest()
1695 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1699 ut = utext_openUChars(ut, u16str, -1, &status); in FreezeTest()
1701 writable = utext_isWritable(ut); in FreezeTest()
1703 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1707 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1709 writable = utext_isWritable(ut); in FreezeTest()
1711 utext_freeze(ut); in FreezeTest()
1712 writable = utext_isWritable(ut); in FreezeTest()
1714 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1718 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1720 ut2 = utext_clone(ut2, ut, FALSE, FALSE, &status); // clone with readonly = false in FreezeTest()
1724 ut2 = utext_clone(ut2, ut, FALSE, TRUE, &status); // clone with readonly = true in FreezeTest()
1732 ut = utext_openConstUnicodeString(ut, (const UnicodeString *)&ustr, &status); in FreezeTest()
1734 writable = utext_isWritable(ut); in FreezeTest()
1736 utext_copy(ut, 1, 2, 0, TRUE, &status); in FreezeTest()
1741 ut = utext_openUnicodeString(ut, &ustr, &status); in FreezeTest()
1743 utext_freeze(ut); in FreezeTest()
1744 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone in FreezeTest()
1753 ut = utext_openUChars(ut, u16str, -1, &status); in FreezeTest()
1755 utext_freeze(ut); in FreezeTest()
1756 ut2 = utext_clone(ut2, ut, TRUE, FALSE, &status); // deep clone in FreezeTest()
1762 utext_close(ut); in FreezeTest()
1778 fragTextAccess(UText *ut, int64_t index, UBool forward) { in fragTextAccess() argument
1779 const UnicodeString *us = (const UnicodeString *)ut->context; in fragTextAccess()
1784 ut->b = c | c<<16; in fragTextAccess()
1785 ut->chunkOffset = 0; in fragTextAccess()
1786 ut->chunkLength = 1; in fragTextAccess()
1787 ut->chunkNativeStart = index; in fragTextAccess()
1788 ut->chunkNativeLimit = index+1; in fragTextAccess()
1793 ut->b = c | c<<16; in fragTextAccess()
1794 ut->chunkOffset = 1; in fragTextAccess()
1795 ut->chunkLength = 1; in fragTextAccess()
1796 ut->chunkNativeStart = index-1; in fragTextAccess()
1797 ut->chunkNativeLimit = index; in fragTextAccess()
1800 ut->b = 0; in fragTextAccess()
1801 ut->chunkOffset = 0; in fragTextAccess()
1802 ut->chunkLength = 0; in fragTextAccess()
1804 ut->chunkNativeStart = 0; in fragTextAccess()
1805 ut->chunkNativeLimit = 0; in fragTextAccess()
1807 ut->chunkNativeStart = length; in fragTextAccess()
1808 ut->chunkNativeLimit = length; in fragTextAccess()
1839 openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) { in openFragmentedUnicodeString() argument
1840 ut = utext_openUnicodeString(ut, s, status); in openFragmentedUnicodeString()
1842 return ut; in openFragmentedUnicodeString()
1847 memcpy(&fragmentFuncs, ut->pFuncs, sizeof(fragmentFuncs)); in openFragmentedUnicodeString()
1850 ut->pFuncs = &fragmentFuncs; in openFragmentedUnicodeString()
1852 ut->chunkContents = (UChar *)&ut->b; in openFragmentedUnicodeString()
1853 ut->pFuncs->access(ut, 0, TRUE); in openFragmentedUnicodeString()
1854 return ut; in openFragmentedUnicodeString()
1908 UText *ut = utext_openUChars(NULL, s, -1, &status); in Ticket6847() local
1910 utext_setNativeIndex(ut, 0); in Ticket6847()
1913 int32_t nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1915 while ((c = utext_next32(ut)) != U_SENTINEL) { in Ticket6847()
1922 nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1926 nativeIndex = UTEXT_GETNATIVEINDEX(ut); in Ticket6847()
1928 utext_close(ut); in Ticket6847()