/********************************************************************
- * Copyright (c) 2008-2011, International Business Machines Corporation and
+ * Copyright (c) 2008-2012, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
switch (index) {
TESTCASE(0, testBasic);
TESTCASE(1, testAPI);
- TESTCASE(2, testGreek);
+ TESTCASE(2, testGreekWithFallback);
+ TESTCASE(3, testGreekWithSanitization);
default: name = ""; break;
}
}
* to long unit names for a locale where the locale data does not
* provide short unit names. As of CLDR 1.9, Greek is one such language.
*/
-void TimeUnitTest::testGreek() {
+void TimeUnitTest::testGreekWithFallback() {
UErrorCode status = U_ZERO_ERROR;
const char* locales[] = {"el-GR", "el"};
}
}
+// Test bug9042
+void TimeUnitTest::testGreekWithSanitization() {
+
+ UErrorCode status = U_ZERO_ERROR;
+ Locale elLoc("el");
+ NumberFormat* numberFmt = NumberFormat::createInstance(Locale("el"), status);
+ if (!assertSuccess("NumberFormat::createInstance for el locale", status, TRUE)) return;
+ numberFmt->setMaximumFractionDigits(1);
+
+ TimeUnitFormat* timeUnitFormat = new TimeUnitFormat(elLoc, status);
+ if (!assertSuccess("TimeUnitFormat::TimeUnitFormat for el locale", status)) return;
+
+ timeUnitFormat->setNumberFormat(*numberFmt, status);
+
+ delete numberFmt;
+ delete timeUnitFormat;
+}
+
+
#endif