From 2116c12c205262d37ee890daf9852e775173254f Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 20 Jun 2013 22:20:51 +0000 Subject: [PATCH] ICU-10069 improve error messages" X-SVN-Rev: 33839 --- icu4c/source/test/intltest/numfmtst.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/icu4c/source/test/intltest/numfmtst.cpp b/icu4c/source/test/intltest/numfmtst.cpp index 0534b20f659..bac8d85fc06 100644 --- a/icu4c/source/test/intltest/numfmtst.cpp +++ b/icu4c/source/test/intltest/numfmtst.cpp @@ -2662,8 +2662,22 @@ void NumberFormatTest::expectParseCurrency(const NumberFormat &fmt, const UChar* return; } UErrorCode status = U_ZERO_ERROR; - assertTrue("amount", amount == currencyAmount->getNumber().getDouble(status)); - assertEquals("currency", currency, currencyAmount->getISOCurrency()); + + char theInfo[100]; + sprintf(theInfo, "For locale %s, string \"%s\", currency ", + fmt.getLocale(ULOC_ACTUAL_LOCALE, status).getBaseName(), + text); + u_austrcpy(theInfo+uprv_strlen(theInfo), currency); + + char theOperation[100]; + + uprv_strcpy(theOperation, theInfo); + uprv_strcat(theOperation, ", check amount:"); + assertTrue(theOperation, amount == currencyAmount->getNumber().getDouble(status)); + + uprv_strcpy(theOperation, theInfo); + uprv_strcat(theOperation, ", check currency:"); + assertEquals(theOperation, currency, currencyAmount->getISOCurrency()); } -- 2.40.0