mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-20 20:19:32 +00:00
ICU-5615 Added a test case for 5615 to make sure BreakIterator factory method work for all available locales
X-SVN-Rev: 21123
This commit is contained in:
parent
7d227b0bd2
commit
c77ccbbe0f
1 changed files with 23 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1996-2006, International Business Machines Corporation and *
|
||||
* Copyright (C) 1996-2007, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -820,5 +820,27 @@ public class BreakIteratorTest extends TestFmwk
|
|||
expected.add("them?");
|
||||
generalIteratorTest(lineBreak, expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ticket#5615
|
||||
*/
|
||||
public void TestT5615() {
|
||||
com.ibm.icu.util.ULocale[] ulocales = BreakIterator.getAvailableULocales();
|
||||
int type = 0;
|
||||
com.ibm.icu.util.ULocale loc = null;
|
||||
try {
|
||||
for (int i = 0; i < ulocales.length; i++) {
|
||||
loc = ulocales[i];
|
||||
for (type = 0; type <= 4; ++type) {
|
||||
BreakIterator brk = BreakIterator.getBreakInstance(loc, type);
|
||||
if (brk == null) {
|
||||
errln("ERR: Failed to create an instance type: " + type + " / locale: " + loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
errln("ERR: Failed to create an instance type: " + type + " / locale: " + loc + " / exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue