X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..e4f10fab0c078f399c9deef476d9c9b73b47dff8:/icuSources/test/intltest/itrbnfrt.cpp diff --git a/icuSources/test/intltest/itrbnfrt.cpp b/icuSources/test/intltest/itrbnfrt.cpp index 6604f0f5..87c227d5 100644 --- a/icuSources/test/intltest/itrbnfrt.cpp +++ b/icuSources/test/intltest/itrbnfrt.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * + * Copyright (C) 1996-2009, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* */ @@ -12,7 +12,8 @@ #include "itrbnfrt.h" #include "unicode/fmtable.h" -#include "math.h" // fabs +#include // fabs +#include // current macro not in icu1.8.1 #define TESTCASE(id,test) \ @@ -20,7 +21,7 @@ name = #test; \ if (exec) { \ logln(#test "---"); \ - logln((UnicodeString)""); \ + logln(); \ test(); \ } \ break @@ -41,7 +42,7 @@ void RbnfRoundTripTest::runIndexedTest(int32_t index, UBool exec, const char* &n TESTCASE(8, TestDutchSpelloutRT); TESTCASE(9, TestJapaneseSpelloutRT); TESTCASE(10, TestRussianSpelloutRT); - TESTCASE(11, TestGreekSpelloutRT); + TESTCASE(11, TestPortugueseSpelloutRT); #else TESTCASE(0, TestRBNFDisabled); #endif @@ -64,7 +65,7 @@ RbnfRoundTripTest::TestEnglishSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getUS(), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, -12345678, 12345678); } @@ -82,7 +83,7 @@ RbnfRoundTripTest::TestDurationsRT() = new RuleBasedNumberFormat(URBNF_DURATION, Locale::getUS(), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, 0, 12345678); } @@ -100,7 +101,7 @@ RbnfRoundTripTest::TestSpanishSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale("es", "es"), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, -12345678, 12345678); } @@ -118,7 +119,7 @@ RbnfRoundTripTest::TestFrenchSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getFrance(), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, -12345678, 12345678); } @@ -136,7 +137,7 @@ RbnfRoundTripTest::TestSwissFrenchSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale("fr", "CH"), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, -12345678, 12345678); } @@ -154,7 +155,7 @@ RbnfRoundTripTest::TestItalianSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getItalian(), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, -999999, 999999); } @@ -172,7 +173,7 @@ RbnfRoundTripTest::TestGermanSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getGermany(), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, 0, 12345678); } @@ -190,7 +191,7 @@ RbnfRoundTripTest::TestSwedishSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale("sv", "SE"), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, 0, 12345678); } @@ -208,7 +209,7 @@ RbnfRoundTripTest::TestDutchSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale("nl", "NL"), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, -12345678, 12345678); } @@ -226,7 +227,7 @@ RbnfRoundTripTest::TestJapaneseSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale::getJapan(), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, 0, 12345678); } @@ -244,7 +245,7 @@ RbnfRoundTripTest::TestRussianSpelloutRT() = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale("ru", "RU"), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { doTest(formatter, 0, 12345678); } @@ -252,19 +253,19 @@ RbnfRoundTripTest::TestRussianSpelloutRT() } /** - * Perform an exhaustive round-trip test on the Greek spellout rules + * Perform an exhaustive round-trip test on the Portuguese spellout rules */ void -RbnfRoundTripTest::TestGreekSpelloutRT() +RbnfRoundTripTest::TestPortugueseSpelloutRT() { UErrorCode status = U_ZERO_ERROR; RuleBasedNumberFormat* formatter - = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale("el", "GR"), status); + = new RuleBasedNumberFormat(URBNF_SPELLOUT, Locale("pt", "BR"), status); if (U_FAILURE(status)) { - errln("failed to construct formatter"); + errcheckln(status, "failed to construct formatter - %s", u_errorName(status)); } else { - doTest(formatter, 0, 12345678); + doTest(formatter, -12345678, 12345678); } delete formatter; }