summaryrefslogtreecommitdiff
path: root/icu4j
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2021-01-19 10:16:31 +0000
committerVictor Chang <vichang@google.com>2022-11-14 15:45:43 +0000
commitd90f673ad88c7e2db1f1705d530ec28db94d7cf1 (patch)
tree911f3cb7895b7bde39e5aa962b531e7d3939a7a9 /icu4j
parent921e2028221df7a7cbec6b69949c78cc03ff7737 (diff)
downloadicu-d90f673ad88c7e2db1f1705d530ec28db94d7cf1.tar.gz
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) Test: n/a Change-Id: I472189b196fa1baedb7b05893c9d92618290b3b5
Diffstat (limited to 'icu4j')
-rw-r--r--icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java16
-rw-r--r--icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestConversion.java65
2 files changed, 76 insertions, 5 deletions
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 80e245bcf..36171589b 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
@@ -648,7 +648,9 @@ public class TestCharset extends TestFmwk {
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);
}
@@ -680,7 +682,9 @@ public class TestCharset extends TestFmwk {
}
} 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.
}
}
}
@@ -831,7 +835,9 @@ public class TestCharset extends TestFmwk {
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;
}
@@ -2380,8 +2386,10 @@ public class TestCharset extends TestFmwk {
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 46ce39e44..0b508506a 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 @@ public class TestConversion extends TestFmwk {
* 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 @@ public class TestConversion extends TestFmwk {
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 @@ public class TestConversion extends TestFmwk {
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 + "] ");