-
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2008, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
}
delete formequal;
delete formnew;
-
+
//Testing getLimits()
- double *gotLimits=0;
int32_t count=0;
- gotLimits=(double*)form->getLimits(count);
+ const double *gotLimits=form->getLimits(count);
+#if 1 // ICU 4.8 deprecates and disables the ChoiceFormat getters.
+ if(count != 0 || gotLimits != NULL) {
+ errln("getLimits() returns something, should be disabled");
+ }
+ const UnicodeString *gotFormats=form->getFormats(count);
+ if(count != 0 || gotFormats != NULL) {
+ errln("getFormats() returns something, should be disabled");
+ }
+ const UBool *gotClosures=form->getClosures(count);
+ if(count != 0 || gotClosures != NULL) {
+ errln("getClosures() returns something, should be disabled");
+ }
+#else
if(count != 7){
errln("getLimits didn't update the count correctly\n");
}
errln((UnicodeString)"getLimits didn't get the limits correctly. Expected " + limits[ix] + " Got " + gotLimits[ix]);
}
}
- //Testing getFormat()
+ //Testing getFormats()
count=0;
- UnicodeString *gotFormats=0;
- gotFormats=(UnicodeString*)form->getFormats(count);
+ const UnicodeString *gotFormats=form->getFormats(count);
if(count != 7){
errln("getFormats didn't update the count correctly\n");
}
errln((UnicodeString)"getFormats didn't get the Formats correctly. Expected " + monthNames[ix] + " Got " + gotFormats[ix]);
}
}
-
-
+#endif
+
delete form;
-
}
void
Format* filenumform = NumberFormat::createInstance( status );
if (!filenumform) {
- it_errln("*** test_complex_example filenumform");
+ dataerrln((UnicodeString)"*** test_complex_example filenumform - " + u_errorName(status));
delete fileform;
return;
}
it_logln("------ additional testing in complex test ------");
it_logln();
//
+#if 0 // ICU 4.8 deprecates and disables the ChoiceFormat getters.
int32_t retCount;
const double* retLimits = fileform->getLimits( retCount );
if ((retCount == 4) && (retLimits)
}else{
it_errln("*** getFormats unexpected result!");
}
+#endif
UnicodeString checkstr2[] = {
"There is no folder on Disk_A",
errln("FAIL: fmt1 != fmt2");
}
+#if 0 // ICU 4.8 deprecates and disables the ChoiceFormat getters.
int32_t i;
int32_t count2 = 0;
const double *limits2 = fmt2.getLimits(count2);
}
}
}
+#endif
// Now test both format objects
UnicodeString exp[] = {
1.0, "b",
1.0 + 1e-9, "c");
+#if 0 // ICU 4.8 only checks the pattern syntax, not whether the ranges make sense.
// Try an invalid pattern that isolates a single value.
// [-Inf,1.0) [1.0,1.0) [1.0,+Inf]
_testPattern("0.0#a|1.0#b|1.0#c", FALSE,
// [-Inf,2.0) [2.0,1.0) [1.0,+Inf]
_testPattern("0.0#a|2.0#b|1.0#c", FALSE,
0, 0, 0, 0, 0, 0);
+#endif
}
void TestChoiceFormat::TestChoiceFormatToPatternOverflow()
{
static const double limits[] = {0.1e-78, 1e13, 0.1e78};
UnicodeString monthNames[] = { "one", "two", "three" };
- ChoiceFormat fmt(limits, monthNames, sizeof(limits)/sizeof(limits[0]));
+ ChoiceFormat fmt(limits, monthNames, UPRV_LENGTHOF(limits));
UnicodeString patStr, expectedPattern1("1e-79#one|10000000000000#two|1e+77#three"),
expectedPattern2("1e-079#one|10000000000000#two|1e+077#three");
fmt.toPattern(patStr);