/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2011, International Business Machines Corporation and
+ * Copyright (c) 1997-2012, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
errln("operator+=() failed: expected \"" + expectedValue + "\"\n,got \"" + test2 + "\"");
if (test1.length() != 70)
- errln("length() failed: expected 70, got " + test1.length());
+ errln(UnicodeString("length() failed: expected 70, got ") + test1.length());
if (test2.length() != 30)
- errln("length() failed: expected 30, got " + test2.length());
+ errln(UnicodeString("length() failed: expected 30, got ") + test2.length());
UnicodeString test3;
test3.append((UChar32)0x20402);
errln((UnicodeString)"append failed for UChar32, expected \"\\\\ud841\\\\udc02\", got " + prettify(test3));
}
if(test3.length() != 2){
- errln("append or length failed for UChar32, expected 2, got " + test3.length());
+ errln(UnicodeString("append or length failed for UChar32, expected 2, got ") + test3.length());
}
test3.append((UChar32)0x0074);
if(test3 != CharsToUnicodeString("\\uD841\\uDC02t")){
(startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
;
if (occurrences != 6)
- errln("indexOf failed: expected to find 6 occurrences, found " + occurrences);
-
+ errln(UnicodeString("indexOf failed: expected to find 6 occurrences, found ") + occurrences);
+
for ( occurrences = 0, startPos = 10;
startPos != -1 && startPos < test1.length();
(startPos = test1.indexOf(test2, startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
;
if (occurrences != 4)
- errln("indexOf with starting offset failed: expected to find 4 occurrences, found " + occurrences);
+ errln(UnicodeString("indexOf with starting offset failed: "
+ "expected to find 4 occurrences, found ") + occurrences);
int32_t endPos = 28;
for ( occurrences = 0, startPos = 5;
(startPos = test1.indexOf(test2, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos += 4) : 0)
;
if (occurrences != 4)
- errln("indexOf with starting and ending offsets failed: expected to find 4 occurrences, found " + occurrences);
+ errln(UnicodeString("indexOf with starting and ending offsets failed: "
+ "expected to find 4 occurrences, found ") + occurrences);
//using UChar32 string
for ( startPos=0, occurrences=0;
(startPos = test3.indexOf(test4, startPos)) != -1 ? (++occurrences, startPos += 2) : 0)
;
if (occurrences != 2)
- errln("indexOf failed: expected to find 2 occurrences, found " + occurrences);
+ errln(UnicodeString("indexOf failed: expected to find 2 occurrences, found ") + occurrences);
//---
for ( occurrences = 0, startPos = 0;
(startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
;
if (occurrences != 16)
- errln("indexOf with character failed: expected to find 16 occurrences, found " + occurrences);
+ errln(UnicodeString("indexOf with character failed: "
+ "expected to find 16 occurrences, found ") + occurrences);
for ( occurrences = 0, startPos = 10;
startPos != -1 && startPos < test1.length();
(startPos = test1.indexOf(testChar, startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
;
if (occurrences != 12)
- errln("indexOf with character & start offset failed: expected to find 12 occurrences, found " + occurrences);
+ errln(UnicodeString("indexOf with character & start offset failed: "
+ "expected to find 12 occurrences, found ") + occurrences);
for ( occurrences = 0, startPos = 5, endPos = 28;
startPos != -1 && startPos < test1.length();
(startPos = test1.indexOf(testChar, startPos, endPos - startPos)) != -1 ? (++occurrences, startPos += 1) : 0)
;
if (occurrences != 10)
- errln("indexOf with character & start & end offsets failed: expected to find 10 occurrences, found " + occurrences);
+ errln(UnicodeString("indexOf with character & start & end offsets failed: "
+ "expected to find 10 occurrences, found ") + occurrences);
//testing for UChar32
UnicodeString subString;
(startPos = test1.lastIndexOf(test2, 5, startPos - 5)) != -1 ? ++occurrences : 0)
;
if (occurrences != 4)
- errln("lastIndexOf with starting and ending offsets failed: expected to find 4 occurrences, found " + occurrences);
+ errln(UnicodeString("lastIndexOf with starting and ending offsets failed: "
+ "expected to find 4 occurrences, found ") + occurrences);
for ( occurrences = 0, startPos = 32;
startPos != -1;
(startPos = test1.lastIndexOf(testChar, 5, startPos - 5)) != -1 ? ++occurrences : 0)
;
if (occurrences != 11)
- errln("lastIndexOf with character & start & end offsets failed: expected to find 11 occurrences, found " + occurrences);
+ errln(UnicodeString("lastIndexOf with character & start & end offsets failed: "
+ "expected to find 11 occurrences, found ") + occurrences);
//testing UChar32
startPos=test3.length();