Home | History | Annotate | Download | only in intltest

Lines Matching full:test1

75     UnicodeString   test1("Now is the time for all men to come swiftly to the aid of the party.\n");
79 c=(UnicodeString *)test1.clone();
80 test1.insert(24, "good ");
82 if (test1 != expectedValue)
83 errln("insert() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\"");
91 test1.remove(41, 8);
93 if (test1 != expectedValue)
94 errln("remove() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\"");
96 test1.replace(58, 6, "ir country");
98 if (test1 != expectedValue)
99 errln("replace() failed: expected \"" + expectedValue + "\"\n,got \"" + test1 + "\"");
102 test1.extract(0, 15, temp);
115 if (test1.length() != 70)
116 errln(UnicodeString("length() failed: expected 70, got ") + test1.length());
266 UnicodeString test1("this is a test");
279 if (test1 != test2 || test1 == test3 || test1 == test4)
283 if (test1 > test2 || test1 < test2 || !(test1 < test3) || !(test1 > test4) ||
290 if (!(test1 >= test2) || !(test1 <= test2) || !(test1 <= test3) || !(test1 >= test4))
294 if (test1.compare(test2) != 0 || test1.compare(test3) >= 0 || test1.compare(test4) <= 0)
298 if(test1.compare(0, 14, test2) != 0 ||
301 test3.compare(0, 18, test1) <=0 )
313 if (test1.compare(uniChars, 4) <= 0 || test1.compare(uniChars, 4) <= 0)
317 if (test1.compare(0, 14, test2, 0, 14) != 0
318 || test1.compare(0, 14, test3, 0, 14) != 0
319 || test1.compare(0, 14, test4, 12, 14) != 0)
322 if (test1.compare(10, 4, test2, 0, 4) >= 0
323 || test1.compare(10, 4, test3, 22, 9) <= 0
324 || test1.compare(10, 4, test4, 22, 4) != 0)
328 if (test1.compareBetween(0, 14, test2, 0, 14) != 0 || test1.compareBetween(0, 14, test3, 0, 14) != 0
329 || test1.compareBetween(0, 14, test4, 12, 26) != 0)
332 if (test1.compareBetween(10, 14, test2, 0, 4) >= 0 || test1.compareBetween(10, 14, test3, 22, 31) <= 0
333 || test1.compareBetween(10, 14, test4, 22, 26) != 0)
337 test2=test1; // share the buffer, length() too large for the stackBuffer
339 if( test1==test2 || test1<=test2 ||
340 test1.compare(test2)<=0 ||
341 test1.compareCodePointOrder(test2)<=0 ||
342 test1.compareCodePointOrder(0, INT32_MAX, test2)<=0 ||
343 test1.compareCodePointOrder(0, INT32_MAX, test2, 0, INT32_MAX)<=0 ||
344 test1.compareCodePointOrderBetween(0, INT32_MAX, test2, 0, INT32_MAX)<=0 ||
345 test1.caseCompare(test2, U_FOLD_CASE_DEFAULT)<=0
466 UnicodeString test1("Now is the time for all good men to come to the aid of their country.", "");
473 test1.extract(11, 12, test2);
474 test1.extract(11, 12, test3);
475 if (test1.extract(11, 12, test4) != 12 || test4[12] != 0) {
480 test1.extractBetween(-3, 7, test5);
485 test1.extractBetween(11, 23, test5);
486 if (test1.extract(60, 71, test6) != 9) {
489 if (test1.extract(11, 12, test6) != 12) {
496 if (test1.extract(11, 12, (char *)NULL) != 12) {
499 if (test1.extract(11, -1, test6) != 0) {
504 if (test1.charAt((int32_t)(11 + i)) != test2.charAt(i)) {
508 if (test1.charAt((int32_t)(11 + i)) != test3[i]) {
512 if (((char)test1.charAt((int32_t)(11 + i))) != test4b.charAt(i)) {
516 if (test1.charAt((int32_t)(11 + i)) != test5.charAt(i)) {
523 if (test1.extract(0, 10, (char *)NULL, "") != 10) {
528 if (test1.extract(0, 10, test4, 2, "") != 10) {
654 UnicodeString test1("The rain in Spain stays mainly on the plain");
658 UnicodeString& test5 = test1;
660 test1.replace(4, 4, test2, 4, 4);
661 test1.replace(12, 5, test3, 4);
663 test1.replace(17, 4, test3);
664 test1.replace(23, 4, test4);
665 test1.replaceBetween(37, 42, test2, 4, 8);
667 if (test1 != "The SPAM in SPAM SPAMs SPAMly on the SPAM")
670 " got \"" + test1 + "\"");
672 test1.remove(21, 1);
673 test1.removeBetween(26, 28);
675 if (test1 != "The SPAM in SPAM SPAM SPAM on the SPAM")
678 " got \"" + test1 + "\"");
680 for (int32_t i = 0; i < test1.length(); i++) {
682 test1.setCharAt(i, 0x78);
686 if (test1 != "xxx SPAM xx SPAM SPAM SPAM xx xxx SPAM")
689 " got \"" + test1 + "\"");
691 test1.remove();
692 if (test1.length() != 0)
693 errln("Remove() failed: expected empty string, got \"" + test1 + "\"");
699 UnicodeString test1("test test ttest tetest testesteststt");
720 startPos != -1 && startPos < test1.length();
721 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
727 startPos != -1 && startPos < test1.length();
728 (startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
736 startPos != -1 && startPos < test1.length();
737 (startPos = test1.indexOf(test2, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
760 startPos != -1 && startPos < test1.length();
761 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
768 startPos != -1 && startPos < test1.length();
769 (startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
776 startPos != -1 && startPos < test1.length();
777 (startPos = test1.indexOf(testChar, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
811 if(test1.lastIndexOf(test2)!=29) {
812 errln("test1.lastIndexOf(test2)!=29");
815 if(test1.lastIndexOf(test2, 15)!=29 || test1.lastIndexOf(test2, 29)!=29 || test1.lastIndexOf(test2, 30)!=-1) {
816 errln("test1.lastIndexOf(test2, start) failed");
821 (startPos = test1.lastIndexOf(test2, 5, startPos - 5)) != -1 ? ++occurrences : 0)
829 (startPos = test1.lastIndexOf(testChar, 5, startPos - 5)) != -1 ? ++occurrences : 0)
874 UnicodeString test1("hello");
881 returnVal = test1.padLeading(15);
883 if (returnVal == FALSE || test1 != expectedValue)
884 errln("padLeading() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
897 test4.setTo(test1).trim();
899 if (test4 != expectedValue || test1 == expectedValue || test4 != expectedValue)
902 test1.trim();
903 if (test1 != expectedValue)
904 errln("trim() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
916 returnVal = test1.truncate(15);
918 if (returnVal == TRUE || test1 != expectedValue)
919 errln("truncate() failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
935 UnicodeString test1("Now is the time for all good men to come to the aid of their country.");
940 if (!test1.startsWith(test2) || !test1.startsWith(test2, 0, test2.length())) {
941 errln("startsWith() failed: \"" + test2 + "\" should be a prefix of \"" + test1 + "\".");
944 if (test1.startsWith(test3) ||
945 test1.startsWith(test3.getBuffer(), test3.length()) ||
946 test1.startsWith(test3.getTerminatedBuffer(), 0, -1)
948 errln("startsWith() failed: \"" + test3 + "\" shouldn't be a prefix of \"" + test1 + "\".");
951 if (test1.endsWith(test2)) {
952 errln("endsWith() failed: \"" + test2 + "\" shouldn't be a suffix of \"" + test1 + "\".");
955 if (!test1.endsWith(test3)) {
956 errln("endsWith(test3) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
958 if (!test1.endsWith(test3, 0, INT32_MAX)) {
959 errln("endsWith(test3, 0, INT32_MAX) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
962 if(!test1.endsWith(test3.getBuffer(), test3.length())) {
963 errln("endsWith(test3.getBuffer(), test3.length()) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
965 if(!test1.endsWith(test3.getTerminatedBuffer(), 0, -1)) {
966 errln("endsWith(test3.getTerminatedBuffer(), 0, -1) failed: \"" + test3 + "\" should be a suffix of \"" + test1 + "\".");
992 UnicodeString test1("One potato, two potato, three potato, four\n");
998 test1.findAndReplace(test2, test3);
1000 if (test1 != expectedValue)
1001 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
1002 test1.findAndReplace(2, 32, test3, test2);
1004 if (test1 != expectedValue)
1005 errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
1044 UnicodeString test1("This is a test");
1049 test1=UnicodeString(); // make sure that it starts with its stackBuffer
1050 UChar *p=test1.getBuffer(20);
1051 if(test1.getCapacity()<20) {
1055 test1.append((UChar)7); // must not be able to modify the string here
1056 test1.setCharAt(3, 7);
1057 test1.reverse();
1058 if( test1.length()!=0 ||
1059 test1.charAt(0)!=0xffff || test1.charAt(3)!=0xffff ||
1060 test1.getBuffer(10)!=0 || test1.getBuffer()!=0
1068 test1.releaseBuffer(3);
1069 test1.append((UChar)4);
1071 if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.charAt(3)!=4) {
1076 test1.releaseBuffer(1);
1077 if(test1.length()!=4 || test1.charAt(0)!=1 || test1.charAt(1)!=2 || test1.charAt(2)!=3 || test1.charAt(3)!=4) {
1082 const UChar *q=test1.getBuffer(), *r=test1.getBuffer();
1083 if( test1.length()!=4 ||
1091 test1.getBuffer(20)[2]=0;
1092 test1.releaseBuffer(); // implicit -1
1093 if(test1.length()!=2 || test1.charAt(0)!=1 || test1.charAt(1) !=2) {
1098 p=test1.getBuffer(256);
1099 for(int32_t i=0; i<test1.getCapacity(); ++i) {
1102 test1.releaseBuffer(); // implicit -1
1103 if(test1.length()!=test1.getCapacity() || test1.charAt(1)!=1 || test1.charAt(100)!=1 || test1.charAt(test1.getCapacity()-1)!=1) {
1108 test1=UnicodeString("This is another test.", "");
1110 q=test1.getTerminatedBuffer();
1111 if(q[test1.length()]!=0 || test1!=test2 || test2.compare(q, -1)!=0) {
1116 test1.setTo(FALSE, u, 3);
1117 q=test1.getTerminatedBuffer();
1122 test1.setTo(TRUE, u, -1);
1123 q=test1.getTerminatedBuffer();
1124 if(q!=u || test1.length()!=4 || q[3]!=8 || q[4]!=0) {
1128 test1=UNICODE_STRING("la", 2);
1129 test1.append(UNICODE_STRING(" lila", 5).getTerminatedBuffer(), 0, -1);
1130 if(test1!=UNICODE_STRING("la lila", 7)) {
1134 test1.insert(3, UNICODE_STRING("dudum ", 6), 0, INT32_MAX);
1135 if(test1!=UNICODE_STRING("la dudum lila", 13)) {
1140 test1.insert(9, ucs, -1);
1141 if(test1!=UNICODE_STRING("la dudum hm lila", 16)) {
1145 test1.replace(9, 2, (UChar)0x2b);
1146 if(test1!=UNICODE_STRING("la dudum + lila", 15)) {
1150 if(test1.hasMetaData() || UnicodeString().hasMetaData()) {
1155 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789.");
1156 test1.truncate(36); // ensure length()<getCapacity()
1157 test2=test1; // share the buffer
1158 test1.truncate(5);
1159 if(test1.length()!=5 || test1.getTerminatedBuffer()[5]!=0) {
1166 test1=UNICODE_STRING_SIMPLE("abcdefghijklmnopqrstuvwxyz0123456789.");
1167 test1.truncate(36); // ensure length()<getCapacity()
1168 test2=test1; // share the buffer
1169 test1.remove();
1170 if(test1.length()!=0 || test1.getTerminatedBuffer()[0]!=0) {
1437 UnicodeString test1("This is a test");
1442 if (test1.isBogus() || test2.isBogus() || test3.isBogus()) {
1448 test3.setTo(FALSE, test1.getBuffer(), -2);
1452 if (test1.hashCode() != test2.hashCode() || test1.hashCode() == test3.hashCode()) {
1458 if (test1.indexOf(test3) != -1) {
1461 if (test1.lastIndexOf(test3) != -1) {
1464 if (test1.caseCompare(test3, U_FOLD_CASE_DEFAULT) != 1 || test3.caseCompare(test1, U_FOLD_CASE_DEFAULT) != -1) {
1467 if (test1.compareCodePointOrder(test3) != 1 || test3.compareCodePointOrder(test1) != -1) {
1508 if(!test3.isBogus() || (test3=test1).isBogus() || test3!=test1) {
1513 if(!test3.isBogus() || test3.fastCopyFrom(test1).isBogus() || test3!=test1) {
1518 if(!test3.isBogus() || test3.setTo(test1).isBogus() || test3!=test1) {
1523 if(!test3.isBogus() || test3.setTo(test1, 0).isBogus() || test3!=test1) {
1528 if(!test3.isBogus() || test3.setTo(test1, 0, 0x7fffffff).isBogus() || test3!=test1) {
1533 if(!test3.isBogus() || test3.setTo(test1.getBuffer(), test1.length()).isBogus() || test3!=test1) {
1548 if(!test3.isBogus() || test3.setTo(FALSE, test1.getBuffer(), test1.length()).isBogus() || test3!=test1) {
1554 if(!test3.isBogus() || test3.setTo((UChar *)test1.getBuffer(), test1.length(), test1.getCapacity()).isBogus() || test3!=test1) {
1602 if(test1.isBogus() || !(test1=test3).isBogus()) {
1631 if(test1!=test3 || test1.compare(test3)!=0) {
1636 if(test1>=test2 || !(test2>test1) || test1.compare(test2)>=0 || !(test2.compare(test1)>0)) {