• Home
  • Raw
  • Download

Lines Matching refs:test1

78     UnicodeString   test1("Now is the time for all men to come swiftly to the aid of the party.\n");  in TestBasicManipulation()  local
82 c=(UnicodeString *)test1.clone(); in TestBasicManipulation()
83 test1.insert(24, "good "); in TestBasicManipulation()
85 if (test1 != expectedValue) in TestBasicManipulation()
86 errln("insert() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
94 test1.remove(41, 8); in TestBasicManipulation()
96 if (test1 != expectedValue) in TestBasicManipulation()
97 errln("remove() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
99 test1.replace(58, 6, "ir country"); in TestBasicManipulation()
101 if (test1 != expectedValue) in TestBasicManipulation()
102 errln("replace() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\""); in TestBasicManipulation()
105 test1.extract(0, 15, temp); in TestBasicManipulation()
118 if (test1.length() != 70) in TestBasicManipulation()
119 errln("length() failed: expected 70, got " + test1.length()); in TestBasicManipulation()
269 UnicodeString test1("this is a test"); in TestCompare() local
282 if (test1 != test2 || test1 == test3 || test1 == test4) in TestCompare()
286 if (test1 > test2 || test1 < test2 || !(test1 < test3) || !(test1 > test4) || in TestCompare()
293 if (!(test1 >= test2) || !(test1 <= test2) || !(test1 <= test3) || !(test1 >= test4)) in TestCompare()
297 if (test1.compare(test2) != 0 || test1.compare(test3) >= 0 || test1.compare(test4) <= 0) in TestCompare()
301 if(test1.compare(0, 14, test2) != 0 || in TestCompare()
304 test3.compare(0, 18, test1) <=0 ) in TestCompare()
316 if (test1.compare(uniChars, 4) <= 0 || test1.compare(uniChars, 4) <= 0) in TestCompare()
320 if (test1.compare(0, 14, test2, 0, 14) != 0 in TestCompare()
321 || test1.compare(0, 14, test3, 0, 14) != 0 in TestCompare()
322 || test1.compare(0, 14, test4, 12, 14) != 0) in TestCompare()
325 if (test1.compare(10, 4, test2, 0, 4) >= 0 in TestCompare()
326 || test1.compare(10, 4, test3, 22, 9) <= 0 in TestCompare()
327 || test1.compare(10, 4, test4, 22, 4) != 0) in TestCompare()
331 …if (test1.compareBetween(0, 14, test2, 0, 14) != 0 || test1.compareBetween(0, 14, test3, 0, 14) !=… in TestCompare()
332 || test1.compareBetween(0, 14, test4, 12, 26) != 0) in TestCompare()
335 …if (test1.compareBetween(10, 14, test2, 0, 4) >= 0 || test1.compareBetween(10, 14, test3, 22, 31) … in TestCompare()
336 || test1.compareBetween(10, 14, test4, 22, 26) != 0) in TestCompare()
340 test2=test1; // share the buffer, length() too large for the stackBuffer in TestCompare()
342 if( test1==test2 || test1<=test2 || in TestCompare()
343 test1.compare(test2)<=0 || in TestCompare()
344 test1.compareCodePointOrder(test2)<=0 || in TestCompare()
345 test1.compareCodePointOrder(0, INT32_MAX, test2)<=0 || in TestCompare()
346 test1.compareCodePointOrder(0, INT32_MAX, test2, 0, INT32_MAX)<=0 || in TestCompare()
347 test1.compareCodePointOrderBetween(0, INT32_MAX, test2, 0, INT32_MAX)<=0 || in TestCompare()
348 test1.caseCompare(test2, U_FOLD_CASE_DEFAULT)<=0 in TestCompare()
469 … UnicodeString test1("Now is the time for all good men to come to the aid of their country.", ""); in TestExtract() local
476 test1.extract(11, 12, test2); in TestExtract()
477 test1.extract(11, 12, test3); in TestExtract()
478 if (test1.extract(11, 12, test4) != 12 || test4[12] != 0) { in TestExtract()
483 test1.extractBetween(-3, 7, test5); in TestExtract()
488 test1.extractBetween(11, 23, test5); in TestExtract()
489 if (test1.extract(60, 71, test6) != 9) { in TestExtract()
492 if (test1.extract(11, 12, test6) != 12) { in TestExtract()
499 if (test1.extract(11, 12, (char *)NULL) != 12) { in TestExtract()
502 if (test1.extract(11, -1, test6) != 0) { in TestExtract()
507 if (test1.charAt((int32_t)(11 + i)) != test2.charAt(i)) { in TestExtract()
511 if (test1.charAt((int32_t)(11 + i)) != test3[i]) { in TestExtract()
515 if (((char)test1.charAt((int32_t)(11 + i))) != test4b.charAt(i)) { in TestExtract()
519 if (test1.charAt((int32_t)(11 + i)) != test5.charAt(i)) { in TestExtract()
526 if (test1.extract(0, 10, (char *)NULL, "") != 10) { in TestExtract()
531 if (test1.extract(0, 10, test4, 2, "") != 10) { in TestExtract()
657 UnicodeString test1("The rain in Spain stays mainly on the plain"); in TestRemoveReplace() local
661 UnicodeString& test5 = test1; in TestRemoveReplace()
663 test1.replace(4, 4, test2, 4, 4); in TestRemoveReplace()
664 test1.replace(12, 5, test3, 4); in TestRemoveReplace()
666 test1.replace(17, 4, test3); in TestRemoveReplace()
667 test1.replace(23, 4, test4); in TestRemoveReplace()
668 test1.replaceBetween(37, 42, test2, 4, 8); in TestRemoveReplace()
670 if (test1 != "The SPAM in SPAM SPAMs SPAMly on the SPAM") in TestRemoveReplace()
673 " got \"" + test1 + "\""); in TestRemoveReplace()
675 test1.remove(21, 1); in TestRemoveReplace()
676 test1.removeBetween(26, 28); in TestRemoveReplace()
678 if (test1 != "The SPAM in SPAM SPAM SPAM on the SPAM") in TestRemoveReplace()
681 " got \"" + test1 + "\""); in TestRemoveReplace()
683 for (int32_t i = 0; i < test1.length(); i++) { in TestRemoveReplace()
685 test1.setCharAt(i, 0x78); in TestRemoveReplace()
689 if (test1 != "xxx SPAM xx SPAM SPAM SPAM xx xxx SPAM") in TestRemoveReplace()
692 " got \"" + test1 + "\""); in TestRemoveReplace()
694 test1.remove(); in TestRemoveReplace()
695 if (test1.length() != 0) in TestRemoveReplace()
696 errln("Remove() failed: expected empty string, got \"" + test1 + "\""); in TestRemoveReplace()
702 UnicodeString test1("test test ttest tetest testesteststt"); in TestSearching() local
723 startPos != -1 && startPos < test1.length(); in TestSearching()
724 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0) in TestSearching()
730 startPos != -1 && startPos < test1.length(); in TestSearching()
731 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0) in TestSearching()
738 startPos != -1 && startPos < test1.length(); in TestSearching()
739 …(startPos = test1.indexOf(test2, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos +=… in TestSearching()
761 startPos != -1 && startPos < test1.length(); in TestSearching()
762 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0) in TestSearching()
768 startPos != -1 && startPos < test1.length(); in TestSearching()
769 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0) in TestSearching()
775 startPos != -1 && startPos < test1.length(); in TestSearching()
776 …(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()
826 (startPos = test1.lastIndexOf(testChar, 5, startPos - 5)) != -1 ? ++occurrences : 0) in TestSearching()
870 UnicodeString test1("hello"); in TestSpacePadding() local
877 returnVal = test1.padLeading(15); in TestSpacePadding()
879 if (returnVal == FALSE || test1 != expectedValue) in TestSpacePadding()
880 errln("padLeading() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
893 test4.setTo(test1).trim(); in TestSpacePadding()
895 if (test4 != expectedValue || test1 == expectedValue || test4 != expectedValue) in TestSpacePadding()
898 test1.trim(); in TestSpacePadding()
899 if (test1 != expectedValue) in TestSpacePadding()
900 errln("trim() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
912 returnVal = test1.truncate(15); in TestSpacePadding()
914 if (returnVal == TRUE || test1 != expectedValue) in TestSpacePadding()
915 errln("truncate() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestSpacePadding()
931 UnicodeString test1("Now is the time for all good men to come to the aid of their country."); in TestPrefixAndSuffix() local
936 if (!test1.startsWith(test2) || !test1.startsWith(test2, 0, test2.length())) { in TestPrefixAndSuffix()
937 errln("startsWith() failed: \"" + test2 + "\" should be a prefix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
940 if (test1.startsWith(test3) || in TestPrefixAndSuffix()
941 test1.startsWith(test3.getBuffer(), test3.length()) || in TestPrefixAndSuffix()
942 test1.startsWith(test3.getTerminatedBuffer(), 0, -1) in TestPrefixAndSuffix()
944 errln("startsWith() failed: \"" + test3 + "\" shouldn't be a prefix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
947 if (test1.endsWith(test2)) { in TestPrefixAndSuffix()
948 errln("endsWith() failed: \"" + test2 + "\" shouldn't be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
951 if (!test1.endsWith(test3)) { in TestPrefixAndSuffix()
952 errln("endsWith(test3) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
954 if (!test1.endsWith(test3, 0, INT32_MAX)) { in TestPrefixAndSuffix()
955 …endsWith(test3, 0, INT32_MAX) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
958 if(!test1.endsWith(test3.getBuffer(), test3.length())) { in TestPrefixAndSuffix()
959 ….getBuffer(), test3.length()) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
961 if(!test1.endsWith(test3.getTerminatedBuffer(), 0, -1)) { in TestPrefixAndSuffix()
962 …getTerminatedBuffer(), 0, -1) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\"."); in TestPrefixAndSuffix()
988 UnicodeString test1("One potato, two potato, three potato, four\n"); in TestFindAndReplace() local
994 test1.findAndReplace(test2, test3); in TestFindAndReplace()
996 if (test1 != expectedValue) in TestFindAndReplace()
997 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestFindAndReplace()
998 test1.findAndReplace(2, 32, test3, test2); in TestFindAndReplace()
1000 if (test1 != expectedValue) in TestFindAndReplace()
1001 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\"."); in TestFindAndReplace()
1040 UnicodeString test1("This is a test"); in TestMiscellaneous() local
1045 test1=UnicodeString(); // make sure that it starts with its stackBuffer in TestMiscellaneous()
1046 UChar *p=test1.getBuffer(20); in TestMiscellaneous()
1047 if(test1.getCapacity()<20) { in TestMiscellaneous()
1051 test1.append((UChar)7); // must not be able to modify the string here in TestMiscellaneous()
1052 test1.setCharAt(3, 7); in TestMiscellaneous()
1053 test1.reverse(); in TestMiscellaneous()
1054 if( test1.length()!=0 || in TestMiscellaneous()
1055 test1.charAt(0)!=0xffff || test1.charAt(3)!=0xffff || in TestMiscellaneous()
1056 test1.getBuffer(10)!=0 || test1.getBuffer()!=0 in TestMiscellaneous()
1064 test1.releaseBuffer(3); in TestMiscellaneous()
1065 test1.append((UChar)4); in TestMiscellaneous()
1067 …if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.ch… in TestMiscellaneous()
1072 test1.releaseBuffer(1); in TestMiscellaneous()
1073 …if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.ch… in TestMiscellaneous()
1078 const UChar *q=test1.getBuffer(), *r=test1.getBuffer(); in TestMiscellaneous()
1079 if( test1.length()!=4 || in TestMiscellaneous()
1087 test1.getBuffer(20)[2]=0; in TestMiscellaneous()
1088 test1.releaseBuffer(); // implicit -1 in TestMiscellaneous()
1089 if(test1.length()!=2 || test1.charAt(0)!=1 || test1.charAt(1) !=2) { in TestMiscellaneous()
1094 p=test1.getBuffer(256); in TestMiscellaneous()
1095 for(int32_t i=0; i<test1.getCapacity(); ++i) { in TestMiscellaneous()
1098 test1.releaseBuffer(); // implicit -1 in TestMiscellaneous()
1099 …if(test1.length()!=test1.getCapacity() || test1.charAt(1)!=1 || test1.charAt(100)!=1 || test1.char… in TestMiscellaneous()
1104 test1=UnicodeString("This is another test.", ""); in TestMiscellaneous()
1106 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1107 if(q[test1.length()]!=0 || test1!=test2 || test2.compare(q, -1)!=0) { in TestMiscellaneous()
1112 test1.setTo(FALSE, u, 3); in TestMiscellaneous()
1113 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1118 test1.setTo(TRUE, u, -1); in TestMiscellaneous()
1119 q=test1.getTerminatedBuffer(); in TestMiscellaneous()
1120 if(q!=u || test1.length()!=4 || q[3]!=8 || q[4]!=0) { in TestMiscellaneous()
1124 test1=UNICODE_STRING("la", 2); in TestMiscellaneous()
1125 test1.append(UNICODE_STRING(" lila", 5).getTerminatedBuffer(), 0, -1); in TestMiscellaneous()
1126 if(test1!=UNICODE_STRING("la lila", 7)) { in TestMiscellaneous()
1130 test1.insert(3, UNICODE_STRING("dudum ", 6), 0, INT32_MAX); in TestMiscellaneous()
1131 if(test1!=UNICODE_STRING("la dudum lila", 13)) { in TestMiscellaneous()
1136 test1.insert(9, ucs, -1); in TestMiscellaneous()
1137 if(test1!=UNICODE_STRING("la dudum hm lila", 16)) { in TestMiscellaneous()
1141 test1.replace(9, 2, (UChar)0x2b); in TestMiscellaneous()
1142 if(test1!=UNICODE_STRING("la dudum + lila", 15)) { in TestMiscellaneous()
1146 if(test1.hasMetaData() || UnicodeString().hasMetaData()) { in TestMiscellaneous()
1151 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789."); in TestMiscellaneous()
1152 test1.truncate(36); // ensure length()<getCapacity() in TestMiscellaneous()
1153 test2=test1; // share the buffer in TestMiscellaneous()
1154 test1.truncate(5); in TestMiscellaneous()
1155 if(test1.length()!=5 || test1.getTerminatedBuffer()[5]!=0) { in TestMiscellaneous()
1162 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789."); in TestMiscellaneous()
1163 test1.truncate(36); // ensure length()<getCapacity() in TestMiscellaneous()
1164 test2=test1; // share the buffer in TestMiscellaneous()
1165 test1.remove(); in TestMiscellaneous()
1166 if(test1.length()!=0 || test1.getTerminatedBuffer()[0]!=0) { in TestMiscellaneous()
1433 UnicodeString test1("This is a test"); in TestBogus() local
1438 if (test1.isBogus() || test2.isBogus() || test3.isBogus()) { in TestBogus()
1444 test3.setTo(FALSE, test1.getBuffer(), -2); in TestBogus()
1448 if (test1.hashCode() != test2.hashCode() || test1.hashCode() == test3.hashCode()) { in TestBogus()
1454 if (test1.indexOf(test3) != -1) { in TestBogus()
1457 if (test1.lastIndexOf(test3) != -1) { in TestBogus()
1460 …if (test1.caseCompare(test3, U_FOLD_CASE_DEFAULT) != 1 || test3.caseCompare(test1, U_FOLD_CASE_DEF… in TestBogus()
1463 if (test1.compareCodePointOrder(test3) != 1 || test3.compareCodePointOrder(test1) != -1) { in TestBogus()
1504 if(!test3.isBogus() || (test3=test1).isBogus() || test3!=test1) { in TestBogus()
1509 if(!test3.isBogus() || test3.fastCopyFrom(test1).isBogus() || test3!=test1) { in TestBogus()
1514 if(!test3.isBogus() || test3.setTo(test1).isBogus() || test3!=test1) { in TestBogus()
1519 if(!test3.isBogus() || test3.setTo(test1, 0).isBogus() || test3!=test1) { in TestBogus()
1524 if(!test3.isBogus() || test3.setTo(test1, 0, 0x7fffffff).isBogus() || test3!=test1) { in TestBogus()
1529 … if(!test3.isBogus() || test3.setTo(test1.getBuffer(), test1.length()).isBogus() || test3!=test1) { in TestBogus()
1544 …if(!test3.isBogus() || test3.setTo(FALSE, test1.getBuffer(), test1.length()).isBogus() || test3!=t… in TestBogus()
1550 …3.isBogus() || test3.setTo((UChar *)test1.getBuffer(), test1.length(), test1.getCapacity()).isBogu… in TestBogus()
1598 if(test1.isBogus() || !(test1=test3).isBogus()) { in TestBogus()
1627 if(test1!=test3 || test1.compare(test3)!=0) { in TestBogus()
1632 if(test1>=test2 || !(test2>test1) || test1.compare(test2)>=0 || !(test2.compare(test1)>0)) { in TestBogus()