mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-865 Initialize the UErrorCode before the function call.
X-SVN-Rev: 4014
This commit is contained in:
parent
31df6b6d26
commit
8dfe694169
1 changed files with 14 additions and 1 deletions
|
@ -2306,7 +2306,7 @@ void NumberFormatRegressionTest::Test4243108(void) {
|
|||
* NumberFormat objects.
|
||||
*/
|
||||
void NumberFormatRegressionTest::TestJ691(void) {
|
||||
UErrorCode status;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Locale loc("fr", "CH");
|
||||
|
||||
// set up the input date string & expected output
|
||||
|
@ -2315,15 +2315,28 @@ void NumberFormatRegressionTest::TestJ691(void) {
|
|||
|
||||
// create a Calendar for this locale
|
||||
Calendar *cal = Calendar::createInstance(loc, status);
|
||||
if (U_FAILURE(status)) {
|
||||
errln("FAIL: Calendar::createInstance() returned " + (UnicodeString)u_errorName(status));
|
||||
return;
|
||||
}
|
||||
|
||||
// create a NumberFormat for this locale
|
||||
NumberFormat *nf = NumberFormat::createInstance(loc, status);
|
||||
if (U_FAILURE(status)) {
|
||||
errln("FAIL: NumberFormat::createInstance() returned " + (UnicodeString)u_errorName(status));
|
||||
return;
|
||||
}
|
||||
|
||||
// *** Here's the key: We don't want to have to do THIS:
|
||||
// nf->setParseIntegerOnly(TRUE);
|
||||
|
||||
// create the DateFormat
|
||||
DateFormat *df = DateFormat::createDateInstance(DateFormat::kShort, loc);
|
||||
if (U_FAILURE(status)) {
|
||||
errln("FAIL: DateFormat::createInstance() returned " + (UnicodeString)u_errorName(status));
|
||||
return;
|
||||
}
|
||||
|
||||
df->adoptCalendar(cal);
|
||||
df->adoptNumberFormat(nf);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue