Lines Matching full:utext
7 * Tests for the UText and UTextIterator text abstraction classses
15 #include "unicode/utext.h"
25 UText *openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status);
82 // Top Level function for UText testing.
158 // TestString() Run a suite of UText tests on a string.
167 UText *ut = NULL;
291 // ut UText containing the same test text.
293 // nativeMap Mapping from code points to native indexes for the UText.
296 // This function runs a whole series of opertions on each incoming UText.
297 // The UText is deep-cloned prior to each operation, so that the original UText remains unchanged.
299 void UTextTest::TestCMR(const UnicodeString &us, UText *ut, int cpCount, m *nativeMap, m *u16Map) {
406 void UTextTest::TestCopyMove(const UnicodeString &us, UText *ut, UBool move,
411 UText *targetUT = NULL;
416 // clone the UText. The test will be run in the cloned copy
435 // Do the same operation in the UText under test
444 int64_t uti = 0; // UText position, native index.
447 UChar32 utc; // code point from UText
481 UText *ut, // UnicodeText object under test.
482 int32_t nativeStart, // Range to be replaced, in UText native units.
489 UText *targetUT = NULL;
494 // clone the target UText
508 // Do the replace on the UText under test
520 int64_t uti = 0; // UText position, native index.
523 UChar32 utc; // code point from UText
549 // TestAccess Test the read only access functions on a UText, including cloning.
553 void UTextTest::TestAccess(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
554 // Run the standard tests on the caller-supplied UText.
560 UText *shallowClone = utext_clone(NULL, ut, FALSE /*deep*/, FALSE /*readOnly*/, &status);
571 UText *deepClone = utext_clone(NULL, shallowClone, TRUE, FALSE, &status);
582 // TestAccessNoClone() Test the read only access functions on a UText.
586 void UTextTest::TestAccessNoClone(const UnicodeString &us, UText *ut, int cpCount, m *cpMap) {
591 // Check the length from the UText
846 // Close of an unitialized UText. Shouldn't blow up.
848 UText ut;
849 memset(&ut, 0, sizeof(UText));
854 // Double-close of a UText. Shouldn't blow up. UText should still be usable.
857 UText ut = UTEXT_INITIALIZER;
859 UText *ut2 = utext_openUnicodeString(&ut, &s, &status);
863 UText *ut3 = utext_close(&ut);
866 UText *ut4 = utext_close(&ut);
874 // Re-use of a UText, chaining through each of the types of UText
878 UText ut = UTEXT_INITIALIZER;
879 UText *utp;
912 UText ut = UTEXT_INITIALIZER;
936 UText *ut = NULL;
975 UText *uta = utext_openUnicodeString(NULL, &sa, &status);
981 UText *utb = utext_openUChars(NULL, sb, -1, &status);
1009 UText *ut = utext_openUTF8(NULL, u8str, -1, &status);
1082 UText *ut = utext_openUnicodeString(NULL, &u16str, &status);
1137 { // Similar test, with UText over Replaceable
1150 UText *ut = utext_openReplaceable(NULL, &u16str, &status);
1216 UText *ut = NULL;
1217 UText *ut2 = NULL;
1267 // Deep Clone of a frozen UText should re-enable writing in the copy.
1278 // Deep clone of a frozen UText, where the base type is intrinsically non-writable,
1296 // Fragmented UText
1297 // A UText type that works with a chunk size of 1.
1306 fragTextAccess(UText *ut, int64_t index, UBool forward) {
1349 UText *
1350 cloneFragmentedUnicodeString(UText *dest, const UText *src, UBool deep, UErrorCode *status) {
1366 UText *
1367 openFragmentedUnicodeString(UText *ut, UnicodeString *s, UErrorCode *status) {
1373 // Copy of the function table from the stock UnicodeString UText,
1387 // This is only an issue for UText types that work in a local buffer,
1391 // 1. Create an inital UText
1402 UText ut1 = UTEXT_INITIALIZER;
1403 UText ut2 = UTEXT_INITIALIZER;
1436 UText *ut = utext_openUChars(NULL, s, -1, &status);
1465 UText *utf8Text = utext_openUTF8(NULL, utf8_string, -1, &status);
1467 UText *deepClone = utext_clone(NULL, utf8Text, TRUE, FALSE, &status);
1469 UText *shallowClone = utext_clone(NULL, deepClone, FALSE, FALSE, &status);
1477 UText *usText = utext_openUnicodeString(NULL, &usString, &status);
1479 UText *usDeepClone = utext_clone(NULL, usText, TRUE, FALSE, &status);
1481 UText *usShallowClone = utext_clone(NULL, usDeepClone, FALSE, FALSE, &status);
1494 UText *ut = utext_openConstUnicodeString(NULL, &s, &status);
1498 UText *cloned = utext_clone(NULL, ut, TRUE, TRUE, &status);