Android patch: Skip charset tests that fail with customized data.
Suppression of ICU4C test failures was added by the ICU 51 upgrade:
https://android.googlesource.com/platform/external/icu/+/8393335
Suppression of ICU4J test failures was added for ICU 55:
https://android.googlesource.com/platform/external/icu/+/3db47ed
It was then partially reverted for the O release:
https://android.googlesource.com/platform/external/icu/+/b48a108
(cherry picked from commit 630aab079a3a1393e8535367ec7ec86822646437)
Change-Id: Ic32ec8eb822b0a99cf420addef7e413bd9b43ce7
diff --git a/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java b/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java
index 5ffdd41..64cb4a2 100644
--- a/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java
+++ b/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java
@@ -645,7 +645,9 @@
logln("finish: " + hex(finishArray));
}
} catch (CharacterCodingException ex) {
- errln(converter + " roundtrip test failed: " + ex.getMessage());
+ // Android patch: Skip tests that fail with customized data.
+ logln(converter + " roundtrip test failed: " + ex.getMessage());
+ // Android patch end.
ex.printStackTrace(System.err);
}
@@ -677,7 +679,9 @@
}
} else {
if (result.isError()) {
- errln("Error should not have occurred while encoding HZ.(" + i + ")");
+ // Android patch: Skip tests that fail with customized data.
+ logln("Error should not have occurred while encoding HZ.(" + i + ")");
+ // Android patch end.
}
}
}
@@ -828,7 +832,9 @@
return;
} catch (RuntimeException ex) {
if (!currentlybad) {currentlybad = true; badcount++; logln(""); }
- errln(converter + " " + ex.getClass().getName() + ": " + ex.getMessage());
+ // Android patch: Skip tests that fail with customized data.
+ logln(converter + " " + ex.getClass().getName() + ": " + ex.getMessage());
+ // Android patch end.
continue outer;
}
@@ -2377,8 +2383,10 @@
if(!result.isError()){
byte[] expected = {(byte)0xA9, (byte)0xA5, (byte)0xAF, (byte)0xFE, (byte)0xA2, (byte)0xAE};
if(!equals(expected, out.array())){
- errln("Did not get the expected result for substitution bytes. Got: "+
+ // Android patch: Skip tests that fail with customized data.
+ logln("Did not get the expected result for substitution bytes. Got: "+
hex(out.array()));
+ // Android patch end.
}
logln("Output: "+ hex(out.array()));
}else{
diff --git a/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestConversion.java b/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestConversion.java
index 67c1cf6..8e6fd4b 100644
--- a/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestConversion.java
+++ b/icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestConversion.java
@@ -162,9 +162,35 @@
* This feature is not in ICU4J.
* See #9601
*/
+ // Android patch: Skip tests that fail with customized data.
String [] testsToSkip = {
- "*test2"
+ "*test2",
+ "EUC-TW",
+ "gb18030",
+ "ibm-1386",
+ "ibm-1390",
+ "ibm-1390,swaplfnl",
+ "ibm-1399",
+ "ibm-16684",
+ "ibm-25546",
+ "ibm-930",
+ "ibm-943",
+ "ibm-970",
+ "ibm-971",
+ "IBM-eucJP",
+ "iso-2022-cn",
+ "iso-2022-jp",
+ "ISO-2022-JP-2",
+ "iso-2022-kr",
+ "ISO-2022-KR",
+ "JIS",
+ "JIS7",
+ "JIS8",
+ "lmbcs",
+ "windows-936",
+ "x11-compound-text",
};
+ // Android patch end.
for (int i = 0; i < testsToSkip.length; i++) {
if (cc.charset.equals(testsToSkip[i])) {
logln("");
@@ -465,6 +491,20 @@
return;
}
+ // Android patch: Skip tests that fail with customized data.
+ String [] testsToSkip = {
+ "ibm-1390,swaplfnl",
+ };
+ for (int i = 0; i < testsToSkip.length; i++) {
+ if (cc.charset.equals(testsToSkip[i])) {
+ logln("");
+ logln("Skipping: " + cc.charset);
+ logln("...............................................");
+ return;
+ }
+ }
+ // Android patch end.
+
// ----for debugging only
logln("");
logln("TestToUnicode[" + caseNr + "] " + cc.charset + " ");
@@ -903,6 +943,29 @@
cc.which = ((ICUResourceBundle) testcase.getObject("which")).getInt(); // only checking for ROUNDTRIP_SET
+ // Android patch: Skip tests that fail with customized data.
+ String [] testsToSkip = {
+ "HZ",
+ "ibm-1390",
+ "ibm-16684",
+ "ibm-25546",
+ "ibm-971",
+ "ISO-2022-CN",
+ "ISO-2022-JP",
+ "ISO-2022-JP-2",
+ "ISO-2022-KR",
+ "JIS7",
+ };
+ for (int i = 0; i < testsToSkip.length; i++) {
+ if (cc.charset.equals(testsToSkip[i])) {
+ logln("");
+ logln("Skipping: " + cc.charset);
+ logln("...............................................");
+ return;
+ }
+ }
+ // Android patch end.
+
// ----for debugging only
logln("");
logln("TestGetUnicodeSet[" + cc.charset + "] ");