Lines Matching refs:test1

65     UnicodeString   test1("Now is the time for all men to come swiftly to the aid of the party.\n");  in TestBasicManipulation()  local
69 c=(UnicodeString *)test1.clone(); in TestBasicManipulation()
70 test1.insert(24, "good "); in TestBasicManipulation()
72 if (test1 != expectedValue) in TestBasicManipulation()
73 errln("insert() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
81 test1.remove(41, 8); in TestBasicManipulation()
83 if (test1 != expectedValue) in TestBasicManipulation()
84 errln("remove() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
86 test1.replace(58, 6, "ir country"); in TestBasicManipulation()
88 if (test1 != expectedValue) in TestBasicManipulation()
89 errln("replace() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
92 test1.extract(0, 15, temp); in TestBasicManipulation()
105 if (test1.length() != 70) in TestBasicManipulation()
106 errln(UnicodeString("length() failed: expected 70, got ") + test1.length()); in TestBasicManipulation()
256 UnicodeString test1("this is a test"); in TestCompare() local
269 if (test1 != test2 || test1 == test3 || test1 == test4) in TestCompare()
273 if (test1 > test2 || test1 < test2 || !(test1 < test3) || !(test1 > test4) || in TestCompare()
280 if (!(test1 >= test2) || !(test1 <= test2) || !(test1 <= test3) || !(test1 >= test4)) in TestCompare()
284 if (test1.compare(test2) != 0 || test1.compare(test3) >= 0 || test1.compare(test4) <= 0) in TestCompare()
288 if(test1.compare(0, 14, test2) != 0 || in TestCompare()
291 test3.compare(0, 18, test1) <=0 ) in TestCompare()
303 if (test1.compare(uniChars, 4) <= 0 || test1.compare(uniChars, 4) <= 0) in TestCompare()
307 if (test1.compare(0, 14, test2, 0, 14) != 0 in TestCompare()
308 || test1.compare(0, 14, test3, 0, 14) != 0 in TestCompare()
309 || test1.compare(0, 14, test4, 12, 14) != 0) in TestCompare()
312 if (test1.compare(10, 4, test2, 0, 4) >= 0 in TestCompare()
313 || test1.compare(10, 4, test3, 22, 9) <= 0 in TestCompare()
314 || test1.compare(10, 4, test4, 22, 4) != 0) in TestCompare()
318 …if (test1.compareBetween(0, 14, test2, 0, 14) != 0 || test1.compareBetween(0, 14, test3, 0, 14) !=… in TestCompare()
319 || test1.compareBetween(0, 14, test4, 12, 26) != 0) in TestCompare()
322 …if (test1.compareBetween(10, 14, test2, 0, 4) >= 0 || test1.compareBetween(10, 14, test3, 22, 31) … in TestCompare()
323 || test1.compareBetween(10, 14, test4, 22, 26) != 0) in TestCompare()
327 test2=test1; // share the buffer, length() too large for the stackBuffer in TestCompare()
329 if( test1==test2 || test1<=test2 || in TestCompare()
330 test1.compare(test2)<=0 || in TestCompare()
331 test1.compareCodePointOrder(test2)<=0 || in TestCompare()
332 test1.compareCodePointOrder(0, INT32_MAX, test2)<=0 || in TestCompare()
333 test1.compareCodePointOrder(0, INT32_MAX, test2, 0, INT32_MAX)<=0 || in TestCompare()
334 test1.compareCodePointOrderBetween(0, INT32_MAX, test2, 0, INT32_MAX)<=0 || in TestCompare()
335 test1.caseCompare(test2, U_FOLD_CASE_DEFAULT)<=0 in TestCompare()
456 … UnicodeString test1("Now is the time for all good men to come to the aid of their country.", ""); in TestExtract() local
463 test1.extract(11, 12, test2); in TestExtract()
464 test1.extract(11, 12, test3); in TestExtract()
465 if (test1.extract(11, 12, test4) != 12 || test4[12] != 0) { in TestExtract()
470 test1.extractBetween(-3, 7, test5); in TestExtract()
475 test1.extractBetween(11, 23, test5); in TestExtract()
476 if (test1.extract(60, 71, test6) != 9) { in TestExtract()
479 if (test1.extract(11, 12, test6) != 12) { in TestExtract()
486 if (test1.extract(11, 12, (char *)NULL) != 12) { in TestExtract()
489 if (test1.extract(11, -1, test6) != 0) { in TestExtract()
494 if (test1.charAt((int32_t)(11 + i)) != test2.charAt(i)) { in TestExtract()
498 if (test1.charAt((int32_t)(11 + i)) != test3[i]) { in TestExtract()
502 if (((char)test1.charAt((int32_t)(11 + i))) != test4b.charAt(i)) { in TestExtract()
506 if (test1.charAt((int32_t)(11 + i)) != test5.charAt(i)) { in TestExtract()
513 if (test1.extract(0, 10, (char *)NULL, "") != 10) { in TestExtract()
518 if (test1.extract(0, 10, test4, 2, "") != 10) { in TestExtract()
644 UnicodeString test1("The rain in Spain stays mainly on the plain"); in TestRemoveReplace() local
648 UnicodeString& test5 = test1; in TestRemoveReplace()
650 test1.replace(4, 4, test2, 4, 4); in TestRemoveReplace()
651 test1.replace(12, 5, test3, 4); in TestRemoveReplace()
653 test1.replace(17, 4, test3); in TestRemoveReplace()
654 test1.replace(23, 4, test4); in TestRemoveReplace()
655 test1.replaceBetween(37, 42, test2, 4, 8); in TestRemoveReplace()
657 if (test1 != "The SPAM in SPAM SPAMs SPAMly on the SPAM") in TestRemoveReplace()
660 " got \"" + test1 + "\""); in TestRemoveReplace()
662 test1.remove(21, 1); in TestRemoveReplace()
663 test1.removeBetween(26, 28); in TestRemoveReplace()
665 if (test1 != "The SPAM in SPAM SPAM SPAM on the SPAM") in TestRemoveReplace()
668 " got \"" + test1 + "\""); in TestRemoveReplace()
670 for (int32_t i = 0; i < test1.length(); i++) { in TestRemoveReplace()
672 test1.setCharAt(i, 0x78); in TestRemoveReplace()
676 if (test1 != "xxx SPAM xx SPAM SPAM SPAM xx xxx SPAM") in TestRemoveReplace()
679 " got \"" + test1 + "\""); in TestRemoveReplace()
681 test1.remove(); in TestRemoveReplace()
682 if (test1.length() != 0) in TestRemoveReplace()
683 errln("Remove() failed: expected empty string, got \"" + test1 + "\""); in TestRemoveReplace()
689 UnicodeString test1("test test ttest tetest testesteststt"); in TestSearching() local
710 startPos != -1 && startPos < test1.length(); in TestSearching()
711 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0) in TestSearching()
717 startPos != -1 && startPos < test1.length(); in TestSearching()
718 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0) in TestSearching()
726 startPos != -1 && startPos < test1.length(); in TestSearching()
727 …(startPos = test1.indexOf(test2, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos +=… in TestSearching()
750 startPos != -1 && startPos < test1.length(); in TestSearching()
751 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0) 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, endPos - startPos)) != -1 ? (++occurrences, startPos… in TestSearching()
801 if(test1.lastIndexOf(test2)!=29) { in TestSearching()
805 …if(test1.lastIndexOf(test2, 15)!=29 || test1.lastIndexOf(test2, 29)!=29 || test1.lastIndexOf(test2… in TestSearching()
811 (startPos = test1.lastIndexOf(test2, 5, startPos - 5)) != -1 ? ++occurrences : 0) in TestSearching()
819 (startPos = test1.lastIndexOf(testChar, 5, startPos - 5)) != -1 ? ++occurrences : 0) in TestSearching()
864 UnicodeString test1("hello"); in TestSpacePadding() local
871 returnVal = test1.padLeading(15); in TestSpacePadding()
873 if (returnVal == FALSE || test1 != expectedValue) in TestSpacePadding()
874 errln("padLeading() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
887 test4.setTo(test1).trim(); in TestSpacePadding()
889 if (test4 != expectedValue || test1 == expectedValue || test4 != expectedValue) in TestSpacePadding()
892 test1.trim(); in TestSpacePadding()
893 if (test1 != expectedValue) in TestSpacePadding()
894 errln("trim() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
906 returnVal = test1.truncate(15); in TestSpacePadding()
908 if (returnVal == TRUE || test1 != expectedValue) in TestSpacePadding()
909 errln("truncate() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
925 UnicodeString test1("Now is the time for all good men to come to the aid of their country."); in TestPrefixAndSuffix() local
930 if (!test1.startsWith(test2) || !test1.startsWith(test2, 0, test2.length())) { in TestPrefixAndSuffix()
931 errln("startsWith() failed: \"" + test2 + "\" should be a prefix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
934 if (test1.startsWith(test3) || in TestPrefixAndSuffix()
935 test1.startsWith(test3.getBuffer(), test3.length()) || in TestPrefixAndSuffix()
936 test1.startsWith(test3.getTerminatedBuffer(), 0, -1) in TestPrefixAndSuffix()
938 errln("startsWith() failed: \"" + test3 + "\" shouldn't be a prefix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
941 if (test1.endsWith(test2)) { in TestPrefixAndSuffix()
942 errln("endsWith() failed: \"" + test2 + "\" shouldn't be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
945 if (!test1.endsWith(test3)) { in TestPrefixAndSuffix()
946 errln("endsWith(test3) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
948 if (!test1.endsWith(test3, 0, INT32_MAX)) { in TestPrefixAndSuffix()
949 …endsWith(test3, 0, INT32_MAX) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
952 if(!test1.endsWith(test3.getBuffer(), test3.length())) { in TestPrefixAndSuffix()
953 ….getBuffer(), test3.length()) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
955 if(!test1.endsWith(test3.getTerminatedBuffer(), 0, -1)) { in TestPrefixAndSuffix()
956 …getTerminatedBuffer(), 0, -1) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
982 UnicodeString test1("One potato, two potato, three potato, four\n"); in TestFindAndReplace() local
988 test1.findAndReplace(test2, test3); in TestFindAndReplace()
990 if (test1 != expectedValue) in TestFindAndReplace()
991 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestFindAndReplace()
992 test1.findAndReplace(2, 32, test3, test2); in TestFindAndReplace()
994 if (test1 != expectedValue) in TestFindAndReplace()
995 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestFindAndReplace()
1034 UnicodeString test1("This is a test"); in TestMiscellaneous() local
1039 test1=UnicodeString(); // make sure that it starts with its stackBuffer in TestMiscellaneous()
1040 UChar *p=test1.getBuffer(20); in TestMiscellaneous()
1041 if(test1.getCapacity()<20) { in TestMiscellaneous()
1045 test1.append((UChar)7); // must not be able to modify the string here in TestMiscellaneous()
1046 test1.setCharAt(3, 7); in TestMiscellaneous()
1047 test1.reverse(); in TestMiscellaneous()
1048 if( test1.length()!=0 || in TestMiscellaneous()
1049 test1.charAt(0)!=0xffff || test1.charAt(3)!=0xffff || in TestMiscellaneous()
1050 test1.getBuffer(10)!=0 || test1.getBuffer()!=0 in TestMiscellaneous()
1058 test1.releaseBuffer(3); in TestMiscellaneous()
1059 test1.append((UChar)4); in TestMiscellaneous()
1061 …if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.ch… in TestMiscellaneous()
1066 test1.releaseBuffer(1); in TestMiscellaneous()
1067 …if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.ch… in TestMiscellaneous()
1072 const UChar *q=test1.getBuffer(), *r=test1.getBuffer(); in TestMiscellaneous()
1073 if( test1.length()!=4 || in TestMiscellaneous()
1081 test1.getBuffer(20)[2]=0; in TestMiscellaneous()
1082 test1.releaseBuffer(); // implicit -1 in TestMiscellaneous()
1083 if(test1.length()!=2 || test1.charAt(0)!=1 || test1.charAt(1) !=2) { in TestMiscellaneous()
1088 p=test1.getBuffer(256); in TestMiscellaneous()
1089 for(int32_t i=0; i<test1.getCapacity(); ++i) { in TestMiscellaneous()
1092 test1.releaseBuffer(); // implicit -1 in TestMiscellaneous()
1093 …if(test1.length()!=test1.getCapacity() || test1.charAt(1)!=1 || test1.charAt(100)!=1 || test1.char… in TestMiscellaneous()
1098 test1=UnicodeString("This is another test.", ""); in TestMiscellaneous()
1100 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1101 if(q[test1.length()]!=0 || test1!=test2 || test2.compare(q, -1)!=0) { in TestMiscellaneous()
1106 test1.setTo(FALSE, u, 3); in TestMiscellaneous()
1107 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1112 test1.setTo(TRUE, u, -1); in TestMiscellaneous()
1113 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1114 if(q!=u || test1.length()!=4 || q[3]!=8 || q[4]!=0) { in TestMiscellaneous()
1118 test1=UNICODE_STRING("la", 2); in TestMiscellaneous()
1119 test1.append(UNICODE_STRING(" lila", 5).getTerminatedBuffer(), 0, -1); in TestMiscellaneous()
1120 if(test1!=UNICODE_STRING("la lila", 7)) { in TestMiscellaneous()
1124 test1.insert(3, UNICODE_STRING("dudum ", 6), 0, INT32_MAX); in TestMiscellaneous()
1125 if(test1!=UNICODE_STRING("la dudum lila", 13)) { in TestMiscellaneous()
1130 test1.insert(9, ucs, -1); in TestMiscellaneous()
1131 if(test1!=UNICODE_STRING("la dudum hm lila", 16)) { in TestMiscellaneous()
1135 test1.replace(9, 2, (UChar)0x2b); in TestMiscellaneous()
1136 if(test1!=UNICODE_STRING("la dudum + lila", 15)) { in TestMiscellaneous()
1140 if(test1.hasMetaData() || UnicodeString().hasMetaData()) { in TestMiscellaneous()
1145 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789."); in TestMiscellaneous()
1146 test1.truncate(36); // ensure length()<getCapacity() in TestMiscellaneous()
1147 test2=test1; // share the buffer in TestMiscellaneous()
1148 test1.truncate(5); in TestMiscellaneous()
1149 if(test1.length()!=5 || test1.getTerminatedBuffer()[5]!=0) { in TestMiscellaneous()
1156 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789."); in TestMiscellaneous()
1157 test1.truncate(36); // ensure length()<getCapacity() in TestMiscellaneous()
1158 test2=test1; // share the buffer in TestMiscellaneous()
1159 test1.remove(); in TestMiscellaneous()
1160 if(test1.length()!=0 || test1.getTerminatedBuffer()[0]!=0) { in TestMiscellaneous()
1169 test1.setTo(TRUE, ucs, 3); in TestMiscellaneous()
1170 assertEquals("length of read-only alias", 3, test1.length()); in TestMiscellaneous()
1171 test1.trim(); in TestMiscellaneous()
1172 assertEquals("length of read-only alias after trim()", 2, test1.length()); in TestMiscellaneous()
1174 2, u_strlen(test1.getTerminatedBuffer())); in TestMiscellaneous()
1435 UnicodeString test1("This is a test"); in TestBogus() local
1440 if (test1.isBogus() || test2.isBogus() || test3.isBogus()) { in TestBogus()
1446 test3.setTo(FALSE, test1.getBuffer(), -2); in TestBogus()
1450 if (test1.hashCode() != test2.hashCode() || test1.hashCode() == test3.hashCode()) { in TestBogus()
1456 if (test1.indexOf(test3) != -1) { in TestBogus()
1459 if (test1.lastIndexOf(test3) != -1) { in TestBogus()
1462 …if (test1.caseCompare(test3, U_FOLD_CASE_DEFAULT) != 1 || test3.caseCompare(test1, U_FOLD_CASE_DEF… in TestBogus()
1465 if (test1.compareCodePointOrder(test3) != 1 || test3.compareCodePointOrder(test1) != -1) { in TestBogus()
1506 if(!test3.isBogus() || (test3=test1).isBogus() || test3!=test1) { in TestBogus()
1511 if(!test3.isBogus() || test3.fastCopyFrom(test1).isBogus() || test3!=test1) { in TestBogus()
1516 if(!test3.isBogus() || test3.setTo(test1).isBogus() || test3!=test1) { in TestBogus()
1521 if(!test3.isBogus() || test3.setTo(test1, 0).isBogus() || test3!=test1) { in TestBogus()
1526 if(!test3.isBogus() || test3.setTo(test1, 0, 0x7fffffff).isBogus() || test3!=test1) { in TestBogus()
1531 … if(!test3.isBogus() || test3.setTo(test1.getBuffer(), test1.length()).isBogus() || test3!=test1) { in TestBogus()
1546 …if(!test3.isBogus() || test3.setTo(FALSE, test1.getBuffer(), test1.length()).isBogus() || test3!=t… in TestBogus()
1552 …3.isBogus() || test3.setTo((UChar *)test1.getBuffer(), test1.length(), test1.getCapacity()).isBogu… in TestBogus()
1600 if(test1.isBogus() || !(test1=test3).isBogus()) { in TestBogus()
1629 if(test1!=test3 || test1.compare(test3)!=0) { in TestBogus()
1634 if(test1>=test2 || !(test2>test1) || test1.compare(test2)>=0 || !(test2.compare(test1)>0)) { in TestBogus()