Lines Matching defs:UnicodeString
73 UnicodeString test1("Now is the time for all men to come swiftly to the aid of the party.\n");
74 UnicodeString expectedValue;
75 UnicodeString *c;
77 c=(UnicodeString *)test1.clone();
102 UnicodeString test2(temp, 15);
114 errln(UnicodeString("length() failed: expected 70, got ") + test1.length());
116 errln(UnicodeString("length() failed: expected 30, got ") + test2.length());
118 UnicodeString test3;
121 errln((UnicodeString)"append failed for UChar32, expected \"\\\\ud841\\\\udc02\", got " + prettify(test3));
124 errln(UnicodeString("append or length failed for UChar32, expected 2, got ") + test3.length());
128 errln((UnicodeString)"append failed for UChar32, expected \"\\\\uD841\\\\uDC02t\", got " + prettify(test3));
131 errln((UnicodeString)"append or length failed for UChar32, expected 2, got " + test3.length());
140 errln((UnicodeString)"simple UChar32 overloads for replace, insert, setTo or = failed");
145 UnicodeString s=UNICODE_STRING("\\U0002f999\\U0001d15f\\u00c4\\u1ed0", 32).unescape();
155 errln("UnicodeString::moveIndex32() failed");
159 errln("UnicodeString::getChar32Start() failed");
163 errln("UnicodeString::getChar32Limit() failed");
169 UnicodeString src("Hello folks how are you?");
170 UnicodeString target1("how are you?");
171 if (target1 != UnicodeString(src, 12)) {
172 errln("UnicodeString(const UnicodeString&, int32_t) failed");
174 UnicodeString target2("folks");
175 if (target2 != UnicodeString(src, 6, 5)) {
176 errln("UnicodeString(const UnicodeString&, int32_t, int32_t) failed");
179 errln("UnicodeString::setTo(const UnicodeString&, int32_t) failed");
185 UnicodeString s=UnicodeString("abc", "")+UnicodeString("def", "")+UnicodeString("ghi", "");
186 if(s!=UnicodeString("abcdefghi", "")) {
195 if(UnicodeString("abc", -1, "")!=UnicodeString("abc", "")) {
196 errln("UnicodeString(codepageData, dataLength, codepage) does not work with dataLength==-1");
200 UnicodeString s, t(buffer, -1, UPRV_LENGTHOF(buffer));
203 errln("UnicodeString.setTo(buffer, length, capacity) does not work with length==-1");
206 errln("UnicodeString(buffer, length, capacity) does not work with length==-1");
210 errln("UnicodeString.caseCompare(const UChar *, length, options) does not work with length==-1");
213 errln("UnicodeString.caseCompare(start, _length, const UChar *, options) does not work");
217 UnicodeString u(buffer, -1, UPRV_LENGTHOF(buffer));
219 errln("UnicodeString.setTo(buffer without NUL, length, capacity) does not work with length==-1");
222 errln("UnicodeString(buffer without NUL, length, capacity) does not work with length==-1");
230 UnicodeString v(cs, -1, cnv, errorCode);
233 errln("UnicodeString(const char *, length, cnv, errorCode) does not work with length==-1");
239 // Test the hardcoded-UTF-8 UnicodeString optimizations.
242 UnicodeString from8a = UnicodeString((const char *)utf8);
243 UnicodeString from8b = UnicodeString((const char *)utf8, (int32_t)sizeof(utf8)-1);
244 UnicodeString from16(FALSE, utf16, UPRV_LENGTHOF(utf16));
246 errln("UnicodeString(const char * U_CHARSET_IS_UTF8) failed");
251 errln("UnicodeString::extract(char * U_CHARSET_IS_UTF8) failed");
255 errln("UnicodeString::extract(substring to char * U_CHARSET_IS_UTF8) failed");
264 UnicodeString test1("this is a test");
265 UnicodeString test2("this is a test");
266 UnicodeString test3("this is a test of the emergency broadcast system");
267 UnicodeString test4("never say, \"this is a test\"!!");
269 UnicodeString test5((UChar)0x5000);
270 UnicodeString test6((UChar)0x5100);
291 // test compare(UnicodeString)
293 errln("compare(UnicodeString) failed");
295 //test compare(offset, length, UnicodeString)
300 errln("compare(offset, length, UnicodeString) failes");
363 UnicodeString u[20]; // must be at least as long as strings[]
367 u[i]=UnicodeString(TRUE, strings[i], -1);
372 errln("error: UnicodeString::compareCodePointOrder() fails for string %d and the following one\n", i);
385 UnicodeString
430 UnicodeString s=UNICODE_STRING("a\\u0308b", 8).unescape();
433 errln("error UnicodeString::compare(..., const UChar *, srcLength=-1) does not work");
437 errln("error UnicodeString::compareCodePointOrder(..., const UChar *, srcLength=-1, ...) does not work");
441 errln("error UnicodeString::caseCompare(..., const UChar *, srcLength=-1, ...) does not work");
445 errln("error UnicodeString::indexOf(const UChar *, srcLength=-1, ...) does not work");
449 errln("error UnicodeString::lastIndexOf(const UChar *, srcLength=-1, ...) does not work");
452 UnicodeString s2, s3;
456 errln("error UnicodeString::replace(..., const UChar *, srcLength=-1, ...) does not work");
464 UnicodeString test1("Now is the time for all good men to come to the aid of their country.", "");
465 UnicodeString test2;
468 UnicodeString test5;
474 errln("UnicodeString.extract(char *) failed to return the correct size of destination buffer.");
480 errln("UnicodeString.extractBetween(-3, 7) did not pin properly.");
485 errln("UnicodeString.extract() failed to return the correct size of destination buffer for end of buffer.");
488 errln("UnicodeString.extract() failed to return the correct size of destination buffer.");
492 UnicodeString test4b(test4, 12);
495 errln("UnicodeString.extract(NULL) failed to return the correct size of destination buffer.");
498 errln("UnicodeString.extract(-1) failed to stop reading the string.");
503 errln(UnicodeString("extracting into a UnicodeString failed at position ") + i);
507 errln(UnicodeString("extracting into an array of UChar failed at position ") + i);
511 errln(UnicodeString("extracting into an array of char failed at position ") + i);
515 errln(UnicodeString("extracting with extractBetween failed at position ") + i);
522 errln("UnicodeString.extract(0, 10, (char *)NULL, \"\") != 10");
527 errln("UnicodeString.extract(0, 10, test4, 2, \"\") != 10");
530 errln("UnicodeString.extract(0, 10, test4, 2, \"\") overwrote test4[2]");
535 UnicodeString s("terminate", "");
546 errln("UnicodeString.extract(NULL, 0)==%d (%s) expected %d (U_BUFFER_OVERFLOW_ERROR)", length, s.length(), u_errorName(errorCode));
552 errln("UnicodeString.extract(dest too short)==%d (%s) expected %d (U_BUFFER_OVERFLOW_ERROR)",
559 errln("UnicodeString.extract(dest just right without NUL)==%d (%s) expected %d (U_STRING_NOT_TERMINATED_WARNING)",
563 errln("UnicodeString.extract(dest just right without NUL) did not extract the string correctly");
569 errln("UnicodeString.extract(dest large enough)==%d (%s) expected %d (U_ZERO_ERROR)",
573 errln("UnicodeString.extract(dest large enough) did not extract the string correctly");
579 UnicodeString s=UNICODE_STRING("\\U0002f999\\U0001d15f\\u00c4\\u1ed0", 32).unescape();
596 errln("UnicodeString::extract(NULL, UConverter) preflighting failed (length=%ld, %s)",
603 errln("UnicodeString::extract(too small, UConverter) preflighting failed (length=%ld, %s)",
610 errln("UnicodeString::extract(UConverter) succeeded with an illegal destination");
614 errln("UnicodeString::extract(UConverter) succeeded with a previous error code");
624 errln("UnicodeString::extract(UConverter) conversion failed (length=%ld, %s)",
633 errln("UnicodeString::extract(\"UTF-8\") conversion failed (length=%ld, %s)",
638 UnicodeString t(expect, sizeof(expect), cnv, errorCode);
640 errln("UnicodeString(UConverter) conversion failed (%s)",
652 UnicodeString test1("The rain in Spain stays mainly on the plain");
653 UnicodeString test2("eat SPAMburgers!");
656 UnicodeString& test5 = test1;
697 UnicodeString test1("test test ttest tetest testesteststt");
698 UnicodeString test2("test");
712 UnicodeString test3(testData);
713 UnicodeString test4(testChar32);
722 errln(UnicodeString("indexOf failed: expected to find 6 occurrences, found ") + occurrences);
729 errln(UnicodeString("indexOf with starting offset failed: "
738 errln(UnicodeString("indexOf with starting and ending offsets failed: "
747 errln((UnicodeString)"indexOf failed: expected to find 4 occurrences, found " + occurrences);
754 errln(UnicodeString("indexOf failed: expected to find 2 occurrences, found ") + occurrences);
762 errln(UnicodeString("indexOf with character failed: "
770 errln(UnicodeString("indexOf with character & start offset failed: "
778 errln(UnicodeString("indexOf with character & start & end offsets failed: "
782 UnicodeString subString;
791 errln((UnicodeString)"indexOf failed: expected to find 14 occurrences, found " + occurrences);
798 errln((UnicodeString)"indexOf failed: expected to find 4 occurrences, found " + occurrences);
806 errln((UnicodeString)"indexOf with character & start & end offsets failed: expected to find 2 occurrences, found " + occurrences);
822 errln(UnicodeString("lastIndexOf with starting and ending offsets failed: "
830 errln(UnicodeString("lastIndexOf with character & start & end offsets failed: "
840 errln((UnicodeString)"lastIndexOf with character & start & end offsets failed: expected to find 3 occurrences, found " + occurrences);
851 errln((UnicodeString)"indexOf failed: expected to find 18 occurrences, found " + occurrences);
859 errln("error: UnicodeString::indexOf(UChar32 surrogate) finds a partial supplementary code point");
861 if( UnicodeString(test3, 0, 17).lastIndexOf((UChar)0xd841, 0) != 4 ||
862 UnicodeString(test3, 0, 17).lastIndexOf((UChar32)0xd841, 2) != 4 ||
865 errln("error: UnicodeString::lastIndexOf(UChar32 surrogate) finds a partial supplementary code point");
872 UnicodeString test1("hello");
873 UnicodeString test2(" there");
874 UnicodeString test3("Hi! How ya doin'? Beautiful day, isn't it?");
875 UnicodeString test4;
877 UnicodeString expectedValue;
898 errln("trim(UnicodeString&) failed");
933 UnicodeString test1("Now is the time for all good men to come to the aid of their country.");
934 UnicodeString test2("Now");
935 UnicodeString test3("country.");
936 UnicodeString test4("count");
978 UnicodeString test("abcde");
990 UnicodeString test1("One potato, two potato, three potato, four\n");
991 UnicodeString test2("potato");
992 UnicodeString test3("MISSISSIPPI");
994 UnicodeString expectedValue;
1009 UnicodeString test("backwards words say to used I");
1029 // UnicodeString::reverse() failed to see a lead surrogate in the middle of
1032 UnicodeString expected=UNICODE_STRING_SIMPLE("e\\U0001F4A9ba").unescape();
1042 UnicodeString test1("This is a test");
1043 UnicodeString test2("This is a test");
1044 UnicodeString test3("Me too!");
1047 test1=UnicodeString(); // make sure that it starts with its stackBuffer
1050 errln("UnicodeString::getBuffer(20).getCapacity()<20");
1060 errln("UnicodeString::getBuffer(minCapacity) allows read or write access to the UnicodeString");
1070 errln("UnicodeString::releaseBuffer(newLength) does not properly reallow access to the UnicodeString");
1076 errln("UnicodeString::releaseBuffer(newLength) without getBuffer(minCapacity) changed the UnicodeString");
1085 errln("UnicodeString::getBuffer(const) does not return a usable buffer pointer");
1092 errln("UnicodeString::releaseBuffer(-1) does not properly set the length of the UnicodeString");
1102 errln("UnicodeString::releaseBuffer(-1 but no NUL) does not properly set the length of the UnicodeString");
1106 test1=UnicodeString("This is another test.", "");
1107 test2=UnicodeString("This is another test.", "");
1117 errln("UnicodeString(u[3]).getTerminatedBuffer() returns a bad buffer");
1123 errln("UnicodeString(u[-1]).getTerminatedBuffer() returns a bad buffer");
1129 errln("UnicodeString::append(const UChar *, start, length) failed");
1134 errln("UnicodeString::insert(start, const UniStr &, start, length) failed");
1140 errln("UnicodeString::insert(start, const UChar *, length) failed");
1145 errln("UnicodeString::replace(start, length, UChar) failed");
1148 if(test1.hasMetaData() || UnicodeString().hasMetaData()) {
1149 errln("UnicodeString::hasMetaData() returns TRUE");
1158 errln("UnicodeString(shared buffer).truncate() failed");
1161 errln("UnicodeString(shared buffer).truncate().getTerminatedBuffer() "
1169 errln("UnicodeString(shared buffer).remove() failed");
1172 errln("UnicodeString(shared buffer).remove().getTerminatedBuffer() "
1191 UnicodeString* test = 0;
1193 test = new UnicodeString(testString);
1218 test = new UnicodeString(workingBuffer, 35, 100);
1226 errln("insert() on stack-allocated UnicodeString didn't work right");
1228 errln("insert() on stack-allocated UnicodeString overwrote guard word!");
1231 errln("insert() on stack-allocated UnicodeString didn't affect backing store");
1235 errln("Stack-allocated UnicodeString overflow didn't work");
1237 errln("Stack-allocated UnicodeString overflow overwrote guard word!");
1241 errln("Assignment to stack-allocated UnicodeString didn't work");
1243 errln("Change to UnicodeString after overflow are still affecting original buffer");
1245 errln("Change to UnicodeString after overflow overwrote guard word!");
1253 errln("UnicodeString.setTo(readonly alias) does not alias correctly");
1256 UnicodeString *c=(UnicodeString *)test->clone();
1260 errln("UnicodeString.setTo(readonly alias) made a copy: did not see change in buffer");
1270 errln("UnicodeString.setTo(readonly alias, length -1) does not alias correctly");
1275 errln("UnicodeString.setTo(unterminated readonly alias, length -1) does not result in isBogus()");
1280 test=new UnicodeString();
1285 errln((UnicodeString)"UnicodeString.setTo(UChar*, length, capacity) does not work correctly\n" + prettify(*test));
1291 UnicodeString c32Test((UChar32)0x10ff2a);
1295 errln("The UnicodeString(UChar32) constructor does not work with a 0x10ff2a filler");
1299 UnicodeString capTest(5, (UChar32)0x2a, 5);
1304 errln("The UnicodeString capacity constructor does not work with an ASCII filler");
1307 capTest = UnicodeString(5, (UChar32)0x10ff2a, 5);
1312 errln("The UnicodeString capacity constructor does not work with a 0x10ff2a filler");
1315 capTest = UnicodeString(5, (UChar32)0, 0);
1317 errln("The UnicodeString capacity constructor does not work with a 0x10ff2a filler");
1325 UnicodeString IN("abc\\u4567 \\n\\r \\U00101234xyz\\x1\\x{5289}\\x1b", -1, US_INV);
1326 UnicodeString OUT("abc");
1335 UnicodeString result = IN.unescape();
1350 /* reference implementation of UnicodeString::hasMoreChar32Than() */
1352 _refUnicodeStringHasMoreChar32Than(const UnicodeString &s, int32_t start, int32_t length, int32_t number) {
1359 UnicodeStringTest::_testUnicodeStringHasMoreChar32Than(const UnicodeString &s, int32_t start, int32_t length, int32_t number) {
1369 UnicodeString s=UNICODE_STRING("\\U0002f999\\U0001d15f\\u00c4\\u1ed0", 32).unescape();
1380 errln("UnicodeString::countChar32() failed");
1411 UnicodeString string(str, UPRV_LENGTHOF(str));
1443 UnicodeString test1("This is a test");
1444 UnicodeString test2("This is a test");
1445 UnicodeString test3("Me too!");
1485 test3.findAndReplace(UnicodeString((UChar)0x61), test2);
1544 if(!test3.isBogus() || test3.setTo((UChar)0x2028).isBogus() || test3!=UnicodeString((UChar)0x2028)) {
1549 if(!test3.isBogus() || test3.setTo((UChar32)0x1d157).isBogus() || test3!=UnicodeString((UChar32)0x1d157)) {
1569 if(!test3.isBogus() || (test3=UnicodeString()).isBogus() || !test3.isEmpty()) {
1570 errln("bogus.operator=(UnicodeString()) failed");
1574 if(!test3.isBogus() || test3.setTo(UnicodeString()).isBogus() || !test3.isEmpty()) {
1575 errln("bogus.setTo(UnicodeString()) failed");
1623 UnicodeString
1671 virtual const UnicodeString *snext(UErrorCode &status) {
1673 unistr=UnicodeString(testEnumStrings[i++], "");
1701 UnicodeString s;
1713 s=UnicodeString(testEnumStrings[i], "");
1714 if(U_FAILURE(status) || pc==NULL || length!=s.length() || UnicodeString(pc, length, "")!=s) {
1728 s=UnicodeString(testEnumStrings[i], "");
1729 if(U_FAILURE(status) || pu==NULL || length!=s.length() || UnicodeString(TRUE, pu, length)!=s) {
1771 s=UnicodeString(testEnumStrings[i], "");
1772 if(U_FAILURE(status) || pu==NULL || length!=s.length() || UnicodeString(TRUE, pu, length)!=s) {
1788 * Define a (bogus) UnicodeString class in another namespace and check for ambiguity.
1791 class UnicodeString {
1794 UnicodeString() : i(1) {}
1795 UnicodeString(UBool /*isTerminated*/, const UChar * /*text*/, int32_t textLength) : i(textLength) {(void)i;}
1796 UnicodeString(const char * /*src*/, int32_t length, enum EInvariant /*inv*/
1805 // Provoke name collision unless the UnicodeString macros properly
1806 // qualify the icu::UnicodeString class.
1809 // Use all UnicodeString macros from unistr.h.
1810 icu::UnicodeString s1=icu::UnicodeString("abc", 3, US_INV);
1811 icu::UnicodeString s2=UNICODE_STRING("def", 3);
1812 icu::UnicodeString s3=UNICODE_STRING_SIMPLE("ghi");
1815 icu::UnicodeString s4=s1+s2+s3;
1817 errln("Something wrong with UnicodeString::operator+().");
1833 UnicodeString from32 = UnicodeString::fromUTF32(utf32, UPRV_LENGTHOF(utf32));
1834 UnicodeString expected(FALSE, expected_utf16, UPRV_LENGTHOF(expected_utf16));
1836 errln("UnicodeString::fromUTF32() did not create the expected string.");
1848 UnicodeString(FALSE, utf16, UPRV_LENGTHOF(utf16)).
1854 errln("UnicodeString::toUTF32() did not create the expected string.");
1891 UnicodeString from8 = UnicodeString::fromUTF8(StringPiece((const char *)utf8, (int32_t)sizeof(utf8)));
1892 UnicodeString expected(FALSE, expected_utf16, UPRV_LENGTHOF(expected_utf16));
1895 errln("UnicodeString::fromUTF8(StringPiece) did not create the expected string.");
1898 UnicodeString from8b = UnicodeString::fromUTF8(utf8_string);
1900 errln("UnicodeString::fromUTF8(std::string) did not create the expected string.");
1910 UnicodeString us(FALSE, utf16, UPRV_LENGTHOF(utf16));
1918 errln("UnicodeString::toUTF8() did not create the expected string.");
1921 errln("UnicodeString::toUTF8(sink) did not sink.Flush().");
1929 errln("UnicodeString::toUTF8String() did not create the expected string.");
1934 static UnicodeString wrapUChars(const UChar *uchars) {
1935 return UnicodeString(TRUE, uchars, -1);
1941 UnicodeString alias(TRUE, uchars, 2);
1943 errln("UnicodeString read-only-aliasing constructor does not behave as expected.");
1948 errln("UnicodeString(read-only-alias).truncate() did not preserve aliasing as expected.");
1951 errln("UnicodeString(read-only-alias).truncate().getTerminatedBuffer() "
1955 errln("UnicodeString(read-only-alias).truncate().getTerminatedBuffer() "
1959 errln("UnicodeString(read-only-alias).truncate().getTerminatedBuffer() "
1965 errln("UnicodeString read-only-aliasing setTo() does not behave as expected.");
1970 errln("UnicodeString(read-only-alias).remove() did not work.");
1973 errln("UnicodeString(read-only-alias).remove().getTerminatedBuffer() "
1977 errln("UnicodeString(read-only-alias).remove().getTerminatedBuffer() "
1981 errln("UnicodeString.setTo(read-only-alias).remove().getTerminatedBuffer() "
1985 UnicodeString longString=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789");
1989 errln("UnicodeString.setTo(read-only-alias).remove(0, 10) did not preserve aliasing as expected.");
1994 errln("UnicodeString.setTo(read-only-alias).remove(27, 99) did not preserve aliasing as expected.");
1999 errln("UnicodeString.setTo(read-only-alias).retainBetween(6, 30) did not preserve aliasing as expected.");
2005 UnicodeString temp;
2008 errln("UnicodeString.tempSubString() failed");
2012 errln("UnicodeString.tempSubString(-3, 5) failed");
2016 errln("UnicodeString.tempSubString(17) failed");
2020 errln("UnicodeString.tempSubString(99) failed");
2024 errln("UnicodeString.tempSubStringBetween(6) failed");
2028 errln("UnicodeString.tempSubStringBetween(8, 18) failed");
2030 UnicodeString bogusString;
2034 errln("UnicodeString.setToBogus().tempSubStringBetween(8, 18) failed");
2039 UnicodeStringTest::doTestAppendable(UnicodeString &dest, Appendable &app) {
2076 explicit SimpleAppendable(UnicodeString &dest) : str(dest) {}
2080 UnicodeString &str;
2085 UnicodeString dest;
2092 UnicodeString dest;
2099 // See the comments in unistr.h near the declaration of UnicodeString's fields.
2101 size_t sizeofUniStr=sizeof(UnicodeString);
2106 errln("sizeof(UnicodeString)=%d, expected UNISTR_OBJECT_SIZE=%d",
2110 errln("sizeof(UnicodeString)=%d < 32, probably too small", (int)sizeofUniStr);
2112 // We assume that the entire UnicodeString object,
2116 UnicodeString s;
2136 UnicodeString s1(FALSE, abc, UPRV_LENGTHOF(abc)); // read-only alias
2137 UnicodeString s2(100, 0x7a, 100); // 100 * 'z' should be on the heap
2138 UnicodeString s3("defg", 4, US_INV); // in stack buffer
2142 errln("UnicodeString.swap() did not swap");
2146 errln("swap(UnicodeString) did not swap back");
2148 UnicodeString s4;
2151 errln("UnicodeString.moveFrom(heap) did not move");
2153 UnicodeString s5;
2156 errln("UnicodeString.moveFrom(stack) did not move");
2158 UnicodeString s6;
2161 errln("UnicodeString.moveFrom(alias) did not move");
2164 s1 = static_cast<UnicodeString &&>(s6);
2166 errln("UnicodeString move assignment operator did not move");
2168 UnicodeString s7(static_cast<UnicodeString &&>(s4));
2170 errln("UnicodeString move constructor did not move");
2184 UnicodeString simple = UNICODE_STRING_SIMPLE("simple");
2187 errln("UnicodeString copy after self-move did not work");
2196 UnicodeString expected(u"abc");
2197 assertEquals("abc from pointer", expected, UnicodeString(carr));
2198 assertEquals("abc from pointer+length", expected, UnicodeString(carr, 3));
2199 assertEquals("abc from read-only-alias pointer", expected, UnicodeString(TRUE, carr, 3));
2201 UnicodeString alias(arr, 0, 4);
2204 assertEquals("buffer=abc from writable alias", expected, UnicodeString(arr, 3));
2207 int32_t length = UnicodeString(u"def").extract(arr, 4, errorCode);
2209 assertEquals("def from extract()", UnicodeString(u"def"), UnicodeString(arr, length));
2218 UnicodeString expected(u"abc");
2219 assertEquals("abc from pointer", expected, UnicodeString(carr));
2220 assertEquals("abc from pointer+length", expected, UnicodeString(carr, 3));
2221 assertEquals("abc from read-only-alias pointer", expected, UnicodeString(TRUE, carr, 3));
2223 UnicodeString alias(arr, 0, 4);
2226 assertEquals("buffer=abc from writable alias", expected, UnicodeString(arr, 3));
2229 int32_t length = UnicodeString(u"def").extract(arr, 4, errorCode);
2231 assertEquals("def from extract()", UnicodeString(u"def"), UnicodeString(arr, length));
2237 assertTrue("empty from nullptr", UnicodeString(nullptr).isEmpty());
2238 assertTrue("empty from nullptr+length", UnicodeString(nullptr, 2).isEmpty());
2239 assertTrue("empty from read-only-alias nullptr", UnicodeString(TRUE, nullptr, 3).isEmpty());
2241 UnicodeString alias(nullptr, 4, 4); // empty, no alias
2244 UnicodeString expected(u"abc");
2248 UnicodeString(u"def").extract(nullptr, 0, errorCode);