mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-97 make it even even easier to debug
X-SVN-Rev: 3156
This commit is contained in:
parent
a5ab27bb1f
commit
c97ae9abcf
2 changed files with 17 additions and 2 deletions
|
@ -13,6 +13,18 @@
|
|||
#include <float.h>
|
||||
#include <limits.h>
|
||||
|
||||
static const char * formattableTypeName(Formattable::Type t)
|
||||
{
|
||||
switch(t) {
|
||||
case Formattable::kDate: return "kDate";
|
||||
case Formattable::kDouble: return "kDouble";
|
||||
case Formattable::kLong: return "kLong";
|
||||
case Formattable::kString: return "kString";
|
||||
case Formattable::kArray: return "kArray";
|
||||
default: return "??unknown??";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This test does round-trip testing (format -> parse -> format -> parse -> etc.) of
|
||||
* NumberFormat.
|
||||
|
@ -59,6 +71,7 @@ IntlTestNumberFormat::testLocale(/* char* par, */const Locale& locale, const Uni
|
|||
{
|
||||
const char* name;
|
||||
|
||||
fLocale = locale;
|
||||
name = "Number test";
|
||||
logln((UnicodeString)name + " (" + localeName + ")");
|
||||
fStatus = U_ZERO_ERROR;
|
||||
|
@ -299,9 +312,10 @@ IntlTestNumberFormat::tryIt(int32_t aNumber)
|
|||
dump = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (number[i].getType() != Formattable::kLong)
|
||||
{
|
||||
errln("********** FAIL: Parse of " + string[i-1] + " returned non-long Formattable.");
|
||||
errln("********** FAIL: Parse of " + string[i-1] + " returned non-long Formattable, type " + UnicodeString(formattableTypeName(number[i].getType())) + ", Locale=" + UnicodeString(fLocale.getName()));
|
||||
dump = TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,8 @@ private:
|
|||
void testLocale(/* char *par, */const Locale& locale, const UnicodeString& localeName);
|
||||
|
||||
NumberFormat* fFormat;
|
||||
UErrorCode fStatus;
|
||||
UErrorCode fStatus;
|
||||
Locale fLocale;
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue