Lines Matching refs:test1
73 UnicodeString test1("Now is the time for all men to come swiftly to the aid of the party.\n"); in TestBasicManipulation() local
77 c=(UnicodeString *)test1.clone(); in TestBasicManipulation()
78 test1.insert(24, "good "); in TestBasicManipulation()
80 if (test1 != expectedValue) in TestBasicManipulation()
81 errln("insert() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
89 test1.remove(41, 8); in TestBasicManipulation()
91 if (test1 != expectedValue) in TestBasicManipulation()
92 errln("remove() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
94 test1.replace(58, 6, "ir country"); in TestBasicManipulation()
96 if (test1 != expectedValue) in TestBasicManipulation()
97 errln("replace() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
100 test1.extract(0, 15, temp); in TestBasicManipulation()
113 if (test1.length() != 70) in TestBasicManipulation()
114 errln(UnicodeString("length() failed: expected 70, got ") + test1.length()); in TestBasicManipulation()
264 UnicodeString test1("this is a test"); in TestCompare() local
277 if (test1 != test2 || test1 == test3 || test1 == test4) in TestCompare()
281 if (test1 > test2 || test1 < test2 || !(test1 < test3) || !(test1 > test4) || in TestCompare()
288 if (!(test1 >= test2) || !(test1 <= test2) || !(test1 <= test3) || !(test1 >= test4)) in TestCompare()
292 if (test1.compare(test2) != 0 || test1.compare(test3) >= 0 || test1.compare(test4) <= 0) in TestCompare()
296 if(test1.compare(0, 14, test2) != 0 || in TestCompare()
299 test3.compare(0, 18, test1) <=0 ) in TestCompare()
311 if (test1.compare(uniChars, 4) <= 0 || test1.compare(uniChars, 4) <= 0) in TestCompare()
315 if (test1.compare(0, 14, test2, 0, 14) != 0 in TestCompare()
316 || test1.compare(0, 14, test3, 0, 14) != 0 in TestCompare()
317 || test1.compare(0, 14, test4, 12, 14) != 0) in TestCompare()
320 if (test1.compare(10, 4, test2, 0, 4) >= 0 in TestCompare()
321 || test1.compare(10, 4, test3, 22, 9) <= 0 in TestCompare()
322 || test1.compare(10, 4, test4, 22, 4) != 0) in TestCompare()
326 …if (test1.compareBetween(0, 14, test2, 0, 14) != 0 || test1.compareBetween(0, 14, test3, 0, 14) !=… in TestCompare()
327 || test1.compareBetween(0, 14, test4, 12, 26) != 0) in TestCompare()
330 …if (test1.compareBetween(10, 14, test2, 0, 4) >= 0 || test1.compareBetween(10, 14, test3, 22, 31) … in TestCompare()
331 || test1.compareBetween(10, 14, test4, 22, 26) != 0) in TestCompare()
335 test2=test1; // share the buffer, length() too large for the stackBuffer in TestCompare()
337 if( test1==test2 || test1<=test2 || in TestCompare()
338 test1.compare(test2)<=0 || in TestCompare()
339 test1.compareCodePointOrder(test2)<=0 || in TestCompare()
340 test1.compareCodePointOrder(0, INT32_MAX, test2)<=0 || in TestCompare()
341 test1.compareCodePointOrder(0, INT32_MAX, test2, 0, INT32_MAX)<=0 || in TestCompare()
342 test1.compareCodePointOrderBetween(0, INT32_MAX, test2, 0, INT32_MAX)<=0 || in TestCompare()
343 test1.caseCompare(test2, U_FOLD_CASE_DEFAULT)<=0 in TestCompare()
464 … UnicodeString test1("Now is the time for all good men to come to the aid of their country.", ""); in TestExtract() local
471 test1.extract(11, 12, test2); in TestExtract()
472 test1.extract(11, 12, test3); in TestExtract()
473 if (test1.extract(11, 12, test4) != 12 || test4[12] != 0) { in TestExtract()
478 test1.extractBetween(-3, 7, test5); in TestExtract()
483 test1.extractBetween(11, 23, test5); in TestExtract()
484 if (test1.extract(60, 71, test6) != 9) { in TestExtract()
487 if (test1.extract(11, 12, test6) != 12) { in TestExtract()
494 if (test1.extract(11, 12, (char *)NULL) != 12) { in TestExtract()
497 if (test1.extract(11, -1, test6) != 0) { in TestExtract()
502 if (test1.charAt((int32_t)(11 + i)) != test2.charAt(i)) { in TestExtract()
506 if (test1.charAt((int32_t)(11 + i)) != test3[i]) { in TestExtract()
510 if (((char)test1.charAt((int32_t)(11 + i))) != test4b.charAt(i)) { in TestExtract()
514 if (test1.charAt((int32_t)(11 + i)) != test5.charAt(i)) { in TestExtract()
521 if (test1.extract(0, 10, (char *)NULL, "") != 10) { in TestExtract()
526 if (test1.extract(0, 10, test4, 2, "") != 10) { in TestExtract()
652 UnicodeString test1("The rain in Spain stays mainly on the plain"); in TestRemoveReplace() local
656 UnicodeString& test5 = test1; in TestRemoveReplace()
658 test1.replace(4, 4, test2, 4, 4); in TestRemoveReplace()
659 test1.replace(12, 5, test3, 4); in TestRemoveReplace()
661 test1.replace(17, 4, test3); in TestRemoveReplace()
662 test1.replace(23, 4, test4); in TestRemoveReplace()
663 test1.replaceBetween(37, 42, test2, 4, 8); in TestRemoveReplace()
665 if (test1 != "The SPAM in SPAM SPAMs SPAMly on the SPAM") in TestRemoveReplace()
668 " got \"" + test1 + "\""); in TestRemoveReplace()
670 test1.remove(21, 1); in TestRemoveReplace()
671 test1.removeBetween(26, 28); in TestRemoveReplace()
673 if (test1 != "The SPAM in SPAM SPAM SPAM on the SPAM") in TestRemoveReplace()
676 " got \"" + test1 + "\""); in TestRemoveReplace()
678 for (int32_t i = 0; i < test1.length(); i++) { in TestRemoveReplace()
680 test1.setCharAt(i, 0x78); in TestRemoveReplace()
684 if (test1 != "xxx SPAM xx SPAM SPAM SPAM xx xxx SPAM") in TestRemoveReplace()
687 " got \"" + test1 + "\""); in TestRemoveReplace()
689 test1.remove(); in TestRemoveReplace()
690 if (test1.length() != 0) in TestRemoveReplace()
691 errln("Remove() failed: expected empty string, got \"" + test1 + "\""); in TestRemoveReplace()
697 UnicodeString test1("test test ttest tetest testesteststt"); in TestSearching() local
718 startPos != -1 && startPos < test1.length(); in TestSearching()
719 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0) in TestSearching()
725 startPos != -1 && startPos < test1.length(); in TestSearching()
726 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0) in TestSearching()
734 startPos != -1 && startPos < test1.length(); in TestSearching()
735 …(startPos = test1.indexOf(test2, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos +=… in TestSearching()
758 startPos != -1 && startPos < test1.length(); in TestSearching()
759 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0) in TestSearching()
766 startPos != -1 && startPos < test1.length(); in TestSearching()
767 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0) in TestSearching()
774 startPos != -1 && startPos < test1.length(); in TestSearching()
775 …(startPos = test1.indexOf(testChar, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos… in TestSearching()
809 if(test1.lastIndexOf(test2)!=29) { in TestSearching()
813 …if(test1.lastIndexOf(test2, 15)!=29 || test1.lastIndexOf(test2, 29)!=29 || test1.lastIndexOf(test2… in TestSearching()
819 (startPos = test1.lastIndexOf(test2, 5, startPos - 5)) != -1 ? ++occurrences : 0) in TestSearching()
827 (startPos = test1.lastIndexOf(testChar, 5, startPos - 5)) != -1 ? ++occurrences : 0) in TestSearching()
872 UnicodeString test1("hello"); in TestSpacePadding() local
879 returnVal = test1.padLeading(15); in TestSpacePadding()
881 if (returnVal == FALSE || test1 != expectedValue) in TestSpacePadding()
882 errln("padLeading() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
895 test4.setTo(test1).trim(); in TestSpacePadding()
897 if (test4 != expectedValue || test1 == expectedValue || test4 != expectedValue) in TestSpacePadding()
900 test1.trim(); in TestSpacePadding()
901 if (test1 != expectedValue) in TestSpacePadding()
902 errln("trim() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
914 returnVal = test1.truncate(15); in TestSpacePadding()
916 if (returnVal == TRUE || test1 != expectedValue) in TestSpacePadding()
917 errln("truncate() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
933 UnicodeString test1("Now is the time for all good men to come to the aid of their country."); in TestPrefixAndSuffix() local
938 if (!test1.startsWith(test2) || !test1.startsWith(test2, 0, test2.length())) { in TestPrefixAndSuffix()
939 errln("startsWith() failed: \"" + test2 + "\" should be a prefix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
942 if (test1.startsWith(test3) || in TestPrefixAndSuffix()
943 test1.startsWith(test3.getBuffer(), test3.length()) || in TestPrefixAndSuffix()
944 test1.startsWith(test3.getTerminatedBuffer(), 0, -1) in TestPrefixAndSuffix()
946 errln("startsWith() failed: \"" + test3 + "\" shouldn't be a prefix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
949 if (test1.endsWith(test2)) { in TestPrefixAndSuffix()
950 errln("endsWith() failed: \"" + test2 + "\" shouldn't be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
953 if (!test1.endsWith(test3)) { in TestPrefixAndSuffix()
954 errln("endsWith(test3) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
956 if (!test1.endsWith(test3, 0, INT32_MAX)) { in TestPrefixAndSuffix()
957 …endsWith(test3, 0, INT32_MAX) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
960 if(!test1.endsWith(test3.getBuffer(), test3.length())) { in TestPrefixAndSuffix()
961 ….getBuffer(), test3.length()) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
963 if(!test1.endsWith(test3.getTerminatedBuffer(), 0, -1)) { in TestPrefixAndSuffix()
964 …getTerminatedBuffer(), 0, -1) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
990 UnicodeString test1("One potato, two potato, three potato, four\n"); in TestFindAndReplace() local
996 test1.findAndReplace(test2, test3); in TestFindAndReplace()
998 if (test1 != expectedValue) in TestFindAndReplace()
999 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestFindAndReplace()
1000 test1.findAndReplace(2, 32, test3, test2); in TestFindAndReplace()
1002 if (test1 != expectedValue) in TestFindAndReplace()
1003 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestFindAndReplace()
1042 UnicodeString test1("This is a test"); in TestMiscellaneous() local
1047 test1=UnicodeString(); // make sure that it starts with its stackBuffer in TestMiscellaneous()
1048 UChar *p=test1.getBuffer(20); in TestMiscellaneous()
1049 if(test1.getCapacity()<20) { in TestMiscellaneous()
1053 test1.append((UChar)7); // must not be able to modify the string here in TestMiscellaneous()
1054 test1.setCharAt(3, 7); in TestMiscellaneous()
1055 test1.reverse(); in TestMiscellaneous()
1056 if( test1.length()!=0 || in TestMiscellaneous()
1057 test1.charAt(0)!=0xffff || test1.charAt(3)!=0xffff || in TestMiscellaneous()
1058 test1.getBuffer(10)!=0 || test1.getBuffer()!=0 in TestMiscellaneous()
1066 test1.releaseBuffer(3); in TestMiscellaneous()
1067 test1.append((UChar)4); in TestMiscellaneous()
1069 …if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.ch… in TestMiscellaneous()
1074 test1.releaseBuffer(1); in TestMiscellaneous()
1075 …if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.ch… in TestMiscellaneous()
1080 const UChar *q=test1.getBuffer(), *r=test1.getBuffer(); in TestMiscellaneous()
1081 if( test1.length()!=4 || in TestMiscellaneous()
1089 test1.getBuffer(20)[2]=0; in TestMiscellaneous()
1090 test1.releaseBuffer(); // implicit -1 in TestMiscellaneous()
1091 if(test1.length()!=2 || test1.charAt(0)!=1 || test1.charAt(1) !=2) { in TestMiscellaneous()
1096 p=test1.getBuffer(256); in TestMiscellaneous()
1097 for(int32_t i=0; i<test1.getCapacity(); ++i) { in TestMiscellaneous()
1100 test1.releaseBuffer(); // implicit -1 in TestMiscellaneous()
1101 …if(test1.length()!=test1.getCapacity() || test1.charAt(1)!=1 || test1.charAt(100)!=1 || test1.char… in TestMiscellaneous()
1106 test1=UnicodeString("This is another test.", ""); in TestMiscellaneous()
1108 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1109 if(q[test1.length()]!=0 || test1!=test2 || test2.compare(q, -1)!=0) { in TestMiscellaneous()
1114 test1.setTo(FALSE, u, 3); in TestMiscellaneous()
1115 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1120 test1.setTo(TRUE, u, -1); in TestMiscellaneous()
1121 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1122 if(q!=u || test1.length()!=4 || q[3]!=8 || q[4]!=0) { in TestMiscellaneous()
1126 test1=UNICODE_STRING("la", 2); in TestMiscellaneous()
1127 test1.append(UNICODE_STRING(" lila", 5).getTerminatedBuffer(), 0, -1); in TestMiscellaneous()
1128 if(test1!=UNICODE_STRING("la lila", 7)) { in TestMiscellaneous()
1132 test1.insert(3, UNICODE_STRING("dudum ", 6), 0, INT32_MAX); in TestMiscellaneous()
1133 if(test1!=UNICODE_STRING("la dudum lila", 13)) { in TestMiscellaneous()
1138 test1.insert(9, ucs, -1); in TestMiscellaneous()
1139 if(test1!=UNICODE_STRING("la dudum hm lila", 16)) { in TestMiscellaneous()
1143 test1.replace(9, 2, (UChar)0x2b); in TestMiscellaneous()
1144 if(test1!=UNICODE_STRING("la dudum + lila", 15)) { in TestMiscellaneous()
1148 if(test1.hasMetaData() || UnicodeString().hasMetaData()) { in TestMiscellaneous()
1153 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789."); in TestMiscellaneous()
1154 test1.truncate(36); // ensure length()<getCapacity() in TestMiscellaneous()
1155 test2=test1; // share the buffer in TestMiscellaneous()
1156 test1.truncate(5); in TestMiscellaneous()
1157 if(test1.length()!=5 || test1.getTerminatedBuffer()[5]!=0) { in TestMiscellaneous()
1164 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789."); in TestMiscellaneous()
1165 test1.truncate(36); // ensure length()<getCapacity() in TestMiscellaneous()
1166 test2=test1; // share the buffer in TestMiscellaneous()
1167 test1.remove(); in TestMiscellaneous()
1168 if(test1.length()!=0 || test1.getTerminatedBuffer()[0]!=0) { in TestMiscellaneous()
1177 test1.setTo(TRUE, ucs, 3); in TestMiscellaneous()
1178 assertEquals("length of read-only alias", 3, test1.length()); in TestMiscellaneous()
1179 test1.trim(); in TestMiscellaneous()
1180 assertEquals("length of read-only alias after trim()", 2, test1.length()); in TestMiscellaneous()
1182 2, u_strlen(test1.getTerminatedBuffer())); in TestMiscellaneous()
1443 UnicodeString test1("This is a test"); in TestBogus() local
1448 if (test1.isBogus() || test2.isBogus() || test3.isBogus()) { in TestBogus()
1454 test3.setTo(FALSE, test1.getBuffer(), -2); in TestBogus()
1458 if (test1.hashCode() != test2.hashCode() || test1.hashCode() == test3.hashCode()) { in TestBogus()
1464 if (test1.indexOf(test3) != -1) { in TestBogus()
1467 if (test1.lastIndexOf(test3) != -1) { in TestBogus()
1470 …if (test1.caseCompare(test3, U_FOLD_CASE_DEFAULT) != 1 || test3.caseCompare(test1, U_FOLD_CASE_DEF… in TestBogus()
1473 if (test1.compareCodePointOrder(test3) != 1 || test3.compareCodePointOrder(test1) != -1) { in TestBogus()
1514 if(!test3.isBogus() || (test3=test1).isBogus() || test3!=test1) { in TestBogus()
1519 if(!test3.isBogus() || test3.fastCopyFrom(test1).isBogus() || test3!=test1) { in TestBogus()
1524 if(!test3.isBogus() || test3.setTo(test1).isBogus() || test3!=test1) { in TestBogus()
1529 if(!test3.isBogus() || test3.setTo(test1, 0).isBogus() || test3!=test1) { in TestBogus()
1534 if(!test3.isBogus() || test3.setTo(test1, 0, 0x7fffffff).isBogus() || test3!=test1) { in TestBogus()
1539 … if(!test3.isBogus() || test3.setTo(test1.getBuffer(), test1.length()).isBogus() || test3!=test1) { in TestBogus()
1554 …if(!test3.isBogus() || test3.setTo(FALSE, test1.getBuffer(), test1.length()).isBogus() || test3!=t… in TestBogus()
1561 test3.setTo(const_cast<UChar *>(test1.getBuffer()), in TestBogus()
1562 test1.length(), test1.getCapacity()).isBogus() || in TestBogus()
1563 test3!=test1) { in TestBogus()
1611 if(test1.isBogus() || !(test1=test3).isBogus()) { in TestBogus()
1640 if(test1!=test3 || test1.compare(test3)!=0) { in TestBogus()
1645 if(test1>=test2 || !(test2>test1) || test1.compare(test2)>=0 || !(test2.compare(test1)>0)) { in TestBogus()