summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2023-09-22 22:32:46 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-09-22 22:32:46 +0000
commit36898dcf58d36b787d5a915de73f183fe9b224e9 (patch)
tree5cc736678bdec8c28399c4015cbb4b40eec98bab
parent517ad5bde83892714bd80dd00bdb57a890bca360 (diff)
parent8bc2fd63d572bc26490f87a96d7c4a0f2c247532 (diff)
downloadicu-36898dcf58d36b787d5a915de73f183fe9b224e9.tar.gz
Android patch: Update ULocaleCollationTest.TestNameList() not to check nameInSelf am: c9d896b2fc am: 8bc2fd63d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/icu/+/24831471 Change-Id: If1884e07f70cf19faa2d71ced9119ef2131c5803 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--android_icu4j/src/main/tests/android/icu/dev/test/util/ULocaleCollationTest.java21
-rw-r--r--icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ULocaleCollationTest.java21
2 files changed, 22 insertions, 20 deletions
diff --git a/android_icu4j/src/main/tests/android/icu/dev/test/util/ULocaleCollationTest.java b/android_icu4j/src/main/tests/android/icu/dev/test/util/ULocaleCollationTest.java
index 4416bb1ca..3e78ea13f 100644
--- a/android_icu4j/src/main/tests/android/icu/dev/test/util/ULocaleCollationTest.java
+++ b/android_icu4j/src/main/tests/android/icu/dev/test/util/ULocaleCollationTest.java
@@ -314,17 +314,18 @@ public class ULocaleCollationTest extends TestFmwk {
expected.add(new UiListItem(new ULocale(rawRow[2]), new ULocale(rawRow[3]), rawRow[0], rawRow[1]));
}
List<UiListItem> newList = names.getUiList(list, false, collator);
- if (!expected.equals(newList)) {
- if (expected.size() != newList.size()) {
- errln(list.toString() + ": wrong size" + expected + ", " + newList);
- } else {
- errln(list.toString());
- for (int i = 0; i < expected.size(); ++i) {
- assertEquals(i+"", expected.get(i), newList.get(i));
- }
- }
+ // Android-changed: Checking nameInSelf is not necessary.
+ if (expected.size() != newList.size()) {
+ errln(list.toString() + ": wrong size" + expected + ", " + newList);
} else {
- assertEquals(list.toString(), expected, newList);
+ String msgHead = list.toString() + ":";
+ for (int i = 0; i < expected.size(); ++i) {
+ UiListItem expectedItem = expected.get(i);
+ UiListItem newItem = newList.get(i);
+ assertEquals(msgHead + i+":minimized", expectedItem.minimized, newItem.minimized);
+ assertEquals(msgHead + i+":modified", expectedItem.modified, newItem.modified);
+ assertEquals(msgHead + i+":nameInDisplayLocale", expectedItem.nameInDisplayLocale, newItem.nameInDisplayLocale);
+ }
}
}
}
diff --git a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ULocaleCollationTest.java b/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ULocaleCollationTest.java
index 170e51c12..185bb7086 100644
--- a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ULocaleCollationTest.java
+++ b/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ULocaleCollationTest.java
@@ -311,17 +311,18 @@ public class ULocaleCollationTest extends TestFmwk {
expected.add(new UiListItem(new ULocale(rawRow[2]), new ULocale(rawRow[3]), rawRow[0], rawRow[1]));
}
List<UiListItem> newList = names.getUiList(list, false, collator);
- if (!expected.equals(newList)) {
- if (expected.size() != newList.size()) {
- errln(list.toString() + ": wrong size" + expected + ", " + newList);
- } else {
- errln(list.toString());
- for (int i = 0; i < expected.size(); ++i) {
- assertEquals(i+"", expected.get(i), newList.get(i));
- }
- }
+ // Android-changed: Checking nameInSelf is not necessary.
+ if (expected.size() != newList.size()) {
+ errln(list.toString() + ": wrong size" + expected + ", " + newList);
} else {
- assertEquals(list.toString(), expected, newList);
+ String msgHead = list.toString() + ":";
+ for (int i = 0; i < expected.size(); ++i) {
+ UiListItem expectedItem = expected.get(i);
+ UiListItem newItem = newList.get(i);
+ assertEquals(msgHead + i+":minimized", expectedItem.minimized, newItem.minimized);
+ assertEquals(msgHead + i+":modified", expectedItem.modified, newItem.modified);
+ assertEquals(msgHead + i+":nameInDisplayLocale", expectedItem.nameInDisplayLocale, newItem.nameInDisplayLocale);
+ }
}
}
}