mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-06 22:15:31 +00:00
ICU-5480 added a test case for getEquivalentID problem reported by JB#5480 in TestEquivalencyGroups
X-SVN-Rev: 20599
This commit is contained in:
parent
f6f17b4a8e
commit
615bf48660
1 changed files with 20 additions and 0 deletions
|
@ -831,6 +831,26 @@ public class TimeZoneTest extends TestFmwk
|
|||
logln("" + i + ":" + s);
|
||||
}
|
||||
}
|
||||
|
||||
// JB#5480 - equivalent IDs should not be empty within range
|
||||
String[] ids = TimeZone.getAvailableIDs();
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
int nEquiv = TimeZone.countEquivalentIDs(ids[i]);
|
||||
// Each equivalent ID must not be empty
|
||||
for (int j = 0; j < nEquiv; j++) {
|
||||
String equivID = TimeZone.getEquivalentID(ids[i], j);
|
||||
if (equivID.length() == 0) {
|
||||
errln("FAIL: getEquivalentID(" + ids[i] + ", " + i +
|
||||
") returned \"" + equivID + "\", expected valid ID");
|
||||
}
|
||||
}
|
||||
// equivalent ID out of range must be empty
|
||||
String outOfRangeID = TimeZone.getEquivalentID(ids[i], nEquiv);
|
||||
if (outOfRangeID.length() != 0) {
|
||||
errln("FAIL: getEquivalentID(" + ids[i] + ", " + i +
|
||||
") returned \"" + outOfRangeID + "\", expected empty string");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TestCountries() {
|
||||
|
|
Loading…
Add table
Reference in a new issue