Home | History | Annotate | Download | only in intltest

Lines Matching full:test1

73     UnicodeString   test1("Now is the time for all men to come swiftly to the aid of the party.\n");
77 c=(UnicodeString *)test1.clone();
78 test1.insert(24, "good ");
80 if (test1 != expectedValue)
81 errln("insert() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\"");
89 test1.remove(41, 8);
91 if (test1 != expectedValue)
92 errln("remove() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\"");
94 test1.replace(58, 6, "ir country");
96 if (test1 != expectedValue)
97 errln("replace() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\"");
100 test1.extract(0, 15, temp);
113 if (test1.length() != 70)
114 errln("length() failed: expected 70, got " + test1.length());
264 UnicodeString test1("this is a test");
277 if (test1 != test2 || test1 == test3 || test1 == test4)
281 if (test1 > test2 || test1 < test2 || !(test1 < test3) || !(test1 > test4) ||
288 if (!(test1 >= test2) || !(test1 <= test2) || !(test1 <= test3) || !(test1 >= test4))
292 if (test1.compare(test2) != 0 || test1.compare(test3) >= 0 || test1.compare(test4) <= 0)
296 if(test1.compare(0, 14, test2) != 0 ||
299 test3.compare(0, 18, test1) <=0 )
311 if (test1.compare(uniChars, 4) <= 0 || test1.compare(uniChars, 4) <= 0)
315 if (test1.compare(0, 14, test2, 0, 14) != 0
316 || test1.compare(0, 14, test3, 0, 14) != 0
317 || test1.compare(0, 14, test4, 12, 14) != 0)
320 if (test1.compare(10, 4, test2, 0, 4) >= 0
321 || test1.compare(10, 4, test3, 22, 9) <= 0
322 || test1.compare(10, 4, test4, 22, 4) != 0)
326 if (test1.compareBetween(0, 14, test2, 0, 14) != 0 || test1.compareBetween(0, 14, test3, 0, 14) != 0
327 || test1.compareBetween(0, 14, test4, 12, 26) != 0)
330 if (test1.compareBetween(10, 14, test2, 0, 4) >= 0 || test1.compareBetween(10, 14, test3, 22, 31) <= 0
331 || test1.compareBetween(10, 14, test4, 22, 26) != 0)
335 test2=test1; // share the buffer, length() too large for the stackBuffer
337 if( test1==test2 || test1<=test2 ||
338 test1.compare(test2)<=0 ||
339 test1.compareCodePointOrder(test2)<=0 ||
340 test1.compareCodePointOrder(0, INT32_MAX, test2)<=0 ||
341 test1.compareCodePointOrder(0, INT32_MAX, test2, 0, INT32_MAX)<=0 ||
342 test1.compareCodePointOrderBetween(0, INT32_MAX, test2, 0, INT32_MAX)<=0 ||
343 test1.caseCompare(test2, U_FOLD_CASE_DEFAULT)<=0
464 UnicodeString test1("Now is the time for all good men to come to the aid of their country.", "");
471 test1.extract(11, 12, test2);
472 test1.extract(11, 12, test3);
473 if (test1.extract(11, 12, test4) != 12 || test4[12] != 0) {
478 test1.extractBetween(-3, 7, test5);
483 test1.extractBetween(11, 23, test5);
484 if (test1.extract(60, 71, test6) != 9) {
487 if (test1.extract(11, 12, test6) != 12) {
494 if (test1.extract(11, 12, (char *)NULL) != 12) {
497 if (test1.extract(11, -1, test6) != 0) {
502 if (test1.charAt((int32_t)(11 + i)) != test2.charAt(i)) {
506 if (test1.charAt((int32_t)(11 + i)) != test3[i]) {
510 if (((char)test1.charAt((int32_t)(11 + i))) != test4b.charAt(i)) {
514 if (test1.charAt((int32_t)(11 + i)) != test5.charAt(i)) {
521 if (test1.extract(0, 10, (char *)NULL, "") != 10) {
526 if (test1.extract(0, 10, test4, 2, "") != 10) {
652 UnicodeString test1("The rain in Spain stays mainly on the plain");
656 UnicodeString& test5 = test1;
658 test1.replace(4, 4, test2, 4, 4);
659 test1.replace(12, 5, test3, 4);
661 test1.replace(17, 4, test3);
662 test1.replace(23, 4, test4);
663 test1.replaceBetween(37, 42, test2, 4, 8);
665 if (test1 != "The SPAM in SPAM SPAMs SPAMly on the SPAM")
668 " got \"" + test1 + "\"");
670 test1.remove(21, 1);
671 test1.removeBetween(26, 28);
673 if (test1 != "The SPAM in SPAM SPAM SPAM on the SPAM")
676 " got \"" + test1 + "\"");
678 for (int32_t i = 0; i < test1.length(); i++) {
680 test1.setCharAt(i, 0x78);
684 if (test1 != "xxx SPAM xx SPAM SPAM SPAM xx xxx SPAM")
687 " got \"" + test1 + "\"");
689 test1.remove();
690 if (test1.length() != 0)
691 errln("Remove() failed: expected empty string, got \"" + test1 + "\"");
697 UnicodeString test1("test test ttest tetest testesteststt");
718 startPos != -1 && startPos < test1.length();
719 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
725 startPos != -1 && startPos < test1.length();
726 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
733 startPos != -1 && startPos < test1.length();
734 (startPos = test1.indexOf(test2, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
756 startPos != -1 && startPos < test1.length();
757 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
763 startPos != -1 && startPos < test1.length();
764 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
770 startPos != -1 && startPos < test1.length();
771 (startPos = test1.indexOf(testChar, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
804 if(test1.lastIndexOf(test2)!=29) {
805 errln("test1.lastIndexOf(test2)!=29");
808 if(test1.lastIndexOf(test2, 15)!=29 || test1.lastIndexOf(test2, 29)!=29 || test1.lastIndexOf(test2, 30)!=-1) {
809 errln("test1.lastIndexOf(test2, start) failed");
814 (startPos = test1.lastIndexOf(test2, 5, startPos - 5)) != -1 ? ++occurrences : 0)
821 (startPos = test1.lastIndexOf(testChar, 5, startPos - 5)) != -1 ? ++occurrences : 0)
865 UnicodeString test1("hello");
872 returnVal = test1.padLeading(15);
874 if (returnVal == FALSE || test1 != expectedValue)
875 errln("padLeading() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
888 test4.setTo(test1).trim();
890 if (test4 != expectedValue || test1 == expectedValue || test4 != expectedValue)
893 test1.trim();
894 if (test1 != expectedValue)
895 errln("trim() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
907 returnVal = test1.truncate(15);
909 if (returnVal == TRUE || test1 != expectedValue)
910 errln("truncate() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
926 UnicodeString test1("Now is the time for all good men to come to the aid of their country.");
931 if (!test1.startsWith(test2) || !test1.startsWith(test2, 0, test2.length())) {
932 errln("startsWith() failed: \"" + test2 + "\" should be a prefix of \"" + test1 + "\".");
935 if (test1.startsWith(test3) ||
936 test1.startsWith(test3.getBuffer(), test3.length()) ||
937 test1.startsWith(test3.getTerminatedBuffer(), 0, -1)
939 errln("startsWith() failed: \"" + test3 + "\" shouldn't be a prefix of \"" + test1 + "\".");
942 if (test1.endsWith(test2)) {
943 errln("endsWith() failed: \"" + test2 + "\" shouldn't be a suffix of \"" + test1 + "\".");
946 if (!test1.endsWith(test3)) {
947 errln("endsWith(test3) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
949 if (!test1.endsWith(test3, 0, INT32_MAX)) {
950 errln("endsWith(test3, 0, INT32_MAX) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
953 if(!test1.endsWith(test3.getBuffer(), test3.length())) {
954 errln("endsWith(test3.getBuffer(), test3.length()) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
956 if(!test1.endsWith(test3.getTerminatedBuffer(), 0, -1)) {
957 errln("endsWith(test3.getTerminatedBuffer(), 0, -1) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
972 UnicodeString test1("One potato, two potato, three potato, four\n");
978 test1.findAndReplace(test2, test3);
980 if (test1 != expectedValue)
981 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
982 test1.findAndReplace(2, 32, test3, test2);
984 if (test1 != expectedValue)
985 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
1014 UnicodeString test1("This is a test");
1019 test1=UnicodeString(); // make sure that it starts with its stackBuffer
1020 UChar *p=test1.getBuffer(20);
1021 if(test1.getCapacity()<20) {
1025 test1.append((UChar)7); // must not be able to modify the string here
1026 test1.setCharAt(3, 7);
1027 test1.reverse();
1028 if( test1.length()!=0 ||
1029 test1.charAt(0)!=0xffff || test1.charAt(3)!=0xffff ||
1030 test1.getBuffer(10)!=0 || test1.getBuffer()!=0
1038 test1.releaseBuffer(3);
1039 test1.append((UChar)4);
1041 if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.charAt(3)!=4) {
1046 test1.releaseBuffer(1);
1047 if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.charAt(3)!=4) {
1052 const UChar *q=test1.getBuffer(), *r=test1.getBuffer();
1053 if( test1.length()!=4 ||
1061 test1.getBuffer(20)[2]=0;
1062 test1.releaseBuffer(); // implicit -1
1063 if(test1.length()!=2 || test1.charAt(0)!=1 || test1.charAt(1) !=2) {
1068 p=test1.getBuffer(256);
1069 for(int32_t i=0; i<test1.getCapacity(); ++i) {
1072 test1.releaseBuffer(); // implicit -1
1073 if(test1.length()!=test1.getCapacity() || test1.charAt(1)!=1 || test1.charAt(100)!=1 || test1.charAt(test1.getCapacity()-1)!=1) {
1078 test1=UnicodeString("This is another test.", "");
1080 q=test1.getTerminatedBuffer();
1081 if(q[test1.length()]!=0 || test1!=test2 || test2.compare(q, -1)!=0) {
1086 test1.setTo(FALSE, u, 3);
1087 q=test1.getTerminatedBuffer();
1092 test1.setTo(TRUE, u, -1);
1093 q=test1.getTerminatedBuffer();
1102 if(test1.length()!=4 || q[3]!=8 || q[4]!=0) {
1106 test1=UNICODE_STRING("la", 2);
1107 test1.append(UNICODE_STRING(" lila", 5).getTerminatedBuffer(), 0, -1);
1108 if(test1!=UNICODE_STRING("la lila", 7)) {
1112 test1.insert(3, UNICODE_STRING("dudum ", 6), 0, INT32_MAX);
1113 if(test1!=UNICODE_STRING("la dudum lila", 13)) {
1118 test1.insert(9, ucs, -1);
1119 if(test1!=UNICODE_STRING("la dudum hm lila", 16)) {
1123 test1.replace(9, 2, (UChar)0x2b);
1124 if(test1!=UNICODE_STRING("la dudum + lila", 15)) {
1128 if(test1.hasMetaData() || UnicodeString().hasMetaData()) {
1391 UnicodeString test1("This is a test");
1396 if (test1.isBogus() || test2.isBogus() || test3.isBogus()) {
1402 test3.setTo(FALSE, test1.getBuffer(), -2);
1406 if (test1.hashCode() != test2.hashCode() || test1.hashCode() == test3.hashCode()) {
1412 if (test1.indexOf(test3) != -1) {
1415 if (test1.lastIndexOf(test3) != -1) {
1418 if (test1.caseCompare(test3, U_FOLD_CASE_DEFAULT) != 1 || test3.caseCompare(test1, U_FOLD_CASE_DEFAULT) != -1) {
1421 if (test1.compareCodePointOrder(test3) != 1 || test3.compareCodePointOrder(test1) != -1) {
1462 if(!test3.isBogus() || (test3=test1).isBogus() || test3!=test1) {
1467 if(!test3.isBogus() || test3.fastCopyFrom(test1).isBogus() || test3!=test1) {
1472 if(!test3.isBogus() || test3.setTo(test1).isBogus() || test3!=test1) {
1477 if(!test3.isBogus() || test3.setTo(test1, 0).isBogus() || test3!=test1) {
1482 if(!test3.isBogus() || test3.setTo(test1, 0, 0x7fffffff).isBogus() || test3!=test1) {
1487 if(!test3.isBogus() || test3.setTo(test1.getBuffer(), test1.length()).isBogus() || test3!=test1) {
1502 if(!test3.isBogus() || test3.setTo(FALSE, test1.getBuffer(), test1.length()).isBogus() || test3!=test1) {
1508 if(!test3.isBogus() || test3.setTo((UChar *)test1.getBuffer(), test1.length(), test1.getCapacity()).isBogus() || test3!=test1) {
1556 if(test1.isBogus() || !(test1=test3).isBogus()) {
1585 if(test1!=test3 || test1.compare(test3)!=0) {
1590 if(test1>=test2 || !(test2>test1) || test1.compare(test2)>=0 || !(test2.compare(test1)>0)) {