]> granicus.if.org Git - icu/commitdiff
ICU-20084 IntlTest, add WHERE macro; remove redundant TEST macros.
authorAndy Heninger <andy.heninger@gmail.com>
Tue, 6 Nov 2018 02:37:38 +0000 (18:37 -0800)
committerAndy Heninger <andy.heninger@gmail.com>
Tue, 13 Nov 2018 19:08:35 +0000 (11:08 -0800)
icu4c/source/test/intltest/dcfmapts.cpp
icu4c/source/test/intltest/intltest.h
icu4c/source/test/intltest/itutil.cpp
icu4c/source/test/intltest/loctest.cpp
icu4c/source/test/intltest/numfmtst.cpp
icu4c/source/test/intltest/rbbiapts.cpp
icu4c/source/test/intltest/rbbitst.cpp
icu4c/source/test/intltest/ustrtest.cpp

index 9fa0e3deee4460e0f9a02b4bdca28014d14a8c17..e64e70819bc41b69ce16115f74c0bdfa0352cc6f 100644 (file)
@@ -649,27 +649,27 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     UErrorCode status = U_ZERO_ERROR;
 
     LocalPointer<DecimalFormat> df(new DecimalFormat("###", status), status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     if (status == U_MISSING_RESOURCE_ERROR) {
         return;
     }
     number::impl::DecimalQuantity fd;
     df->formatToDecimalQuantity(44, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(44, fd.getPluralOperand(PLURAL_OPERAND_N));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df->formatToDecimalQuantity(-44, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(44, fd.getPluralOperand(PLURAL_OPERAND_N));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(TRUE, fd.isNegative());
 
     df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###.00##", status), status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(123.456, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(3, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -679,7 +679,7 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df->formatToDecimalQuantity(-123.456, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(3, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -691,7 +691,7 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     // test max int digits
     df->setMaximumIntegerDigits(2);
     df->formatToDecimalQuantity(123.456, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(3, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -701,7 +701,7 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df->formatToDecimalQuantity(-123.456, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(3, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(456, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -714,7 +714,7 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     df->setMaximumIntegerDigits(2000000000);
     df->setMaximumFractionDigits(2);
     df->formatToDecimalQuantity(123.456, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(46, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(46, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -724,7 +724,7 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df->formatToDecimalQuantity(-123.456, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(46, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(46, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -738,7 +738,7 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     df->setRoundingIncrement(7.3);
 
     df->formatToDecimalQuantity(30.0, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(20, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -748,7 +748,7 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df->formatToDecimalQuantity(-30.0, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V)); // v
     ASSERT_EQUAL(20, fd.getPluralOperand(PLURAL_OPERAND_F)); // f
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_T)); // t
@@ -758,9 +758,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(TRUE, fd.isNegative());
 
     df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###", status), status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(123.456, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -769,9 +769,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###.0", status), status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(123.01, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(1, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -780,9 +780,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df.adoptInsteadAndCheckErrorCode(new DecimalFormat("###.0", status), status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(123.06, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(1, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(1, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(1, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -791,9 +791,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df.adoptInsteadAndCheckErrorCode(new DecimalFormat("@@@@@", status), status);  // Significant Digits
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(123, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -802,9 +802,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df.adoptInsteadAndCheckErrorCode(new DecimalFormat("@@@@@", status), status);  // Significant Digits
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(1.23, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(4, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(2300, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(23, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -813,24 +813,24 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     df->formatToDecimalQuantity(uprv_getInfinity(), fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(TRUE, fd.isNaN() || fd.isInfinite());
     df->formatToDecimalQuantity(0.0, fd, status);
     ASSERT_EQUAL(FALSE, fd.isNaN() || fd.isInfinite());
     df->formatToDecimalQuantity(uprv_getNaN(), fd, status);
     ASSERT_EQUAL(TRUE, fd.isNaN() || fd.isInfinite());
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
 
     // Test Big Decimal input.
     // 22 digits before and after decimal, will exceed the precision of a double
     //    and force DecimalFormat::getFixedDecimal() to work with a digit list.
     df.adoptInsteadAndCheckErrorCode(
         new DecimalFormat("#####################0.00####################", status), status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     Formattable fable("12.34", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(34, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(34, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -839,9 +839,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     fable.setDecimalNumber("12.3456789012345678900123456789", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(22, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(3456789012345678900LL, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(34567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -851,9 +851,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
 
     // On field overflow, Integer part is truncated on the left, fraction part on the right.
     fable.setDecimalNumber("123456789012345678901234567890.123456789012345678901234567890", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(22, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(1234567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(1234567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -863,9 +863,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
 
     // Digits way to the right of the decimal but within the format's precision aren't truncated
     fable.setDecimalNumber("1.0000000000000000000012", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(22, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(12, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(12, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -875,9 +875,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
 
     // Digits beyond the precision of the format are rounded away
     fable.setDecimalNumber("1.000000000000000000000012", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -887,9 +887,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
 
     // Negative numbers come through
     fable.setDecimalNumber("-1.0000000000000000000012", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(22, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(12, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(12, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -899,9 +899,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
 
     // MinFractionDigits from format larger than from number.
     fable.setDecimalNumber("1000000000000000000000.3", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(30, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(3, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -910,9 +910,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     fable.setDecimalNumber("1000000000000000050000.3", status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(30, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(3, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -922,9 +922,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
 
     // Test some int64_t values that are out of the range of a double
     fable.setInt64(4503599627370496LL);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -933,9 +933,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     fable.setInt64(4503599627370497LL);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -944,9 +944,9 @@ void IntlTestDecimalFormatAPI::TestFixedDecimal() {
     ASSERT_EQUAL(FALSE, fd.isNegative());
 
     fable.setInt64(9223372036854775807LL);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     df->formatToDecimalQuantity(fable, fd, status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
     ASSERT_EQUAL(2, fd.getPluralOperand(PLURAL_OPERAND_V));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_F));
     ASSERT_EQUAL(0, fd.getPluralOperand(PLURAL_OPERAND_T));
@@ -1025,11 +1025,6 @@ void IntlTestDecimalFormatAPI::TestRequiredDecimalPoint() {
     }
 }
 
-// WHERE Macro yields a literal string of the form "source_file_name:line number "
-#define WHERE __FILE__ ":" XLINE(__LINE__) " "
-#define XLINE(s) LINE(s)
-#define LINE(s) #s
-
 void IntlTestDecimalFormatAPI::testErrorCode() {
     // Try each DecimalFormat constructor with an errorCode set on input,
     // Verify no crashes or leaks, and that the errorCode is not altered.
index ee3c88324d2923b7d2982aa1252820d67b36db04..37227ba9183597a758178bb1dc40828d8476fa07 100644 (file)
@@ -127,11 +127,11 @@ UnicodeString toString(UBool b);
         break; \
     }
 
-#define TEST_ASSERT_TRUE(x) \
-  assertTrue(#x, (x), FALSE, FALSE, __FILE__, __LINE__)
 
-#define TEST_ASSERT_STATUS(x) \
-  assertSuccess(#x, (x), FALSE, __FILE__, __LINE__)
+// WHERE Macro yields a literal string of the form "source_file_name:line number "
+#define WHERE __FILE__ ":" XLINE(__LINE__) " "
+#define XLINE(s) LINE(s)
+#define LINE(s) #s
 
 class IntlTest : public TestLog {
 public:
index 4d3466120cf557e8677092c124dd147b6268ee82..cd1935ab0ec56754a3486132cda839348da8ba8a 100644 (file)
@@ -874,47 +874,47 @@ void EnumSetTest::TestEnumSet() {
     logln("Enum is from [%d..%d]\n", MAX_NONBOOLEAN+1,
           LIMIT_BOOLEAN);
 
-    TEST_ASSERT_TRUE(flags.get(THING1) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING2) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING3) == FALSE);
+    assertFalse(WHERE, flags.get(THING1));
+    assertFalse(WHERE, flags.get(THING2));
+    assertFalse(WHERE, flags.get(THING3));
 
     logln("get(thing1)=%d, get(thing2)=%d, get(thing3)=%d\n",          flags.get(THING1),          flags.get(THING2),          flags.get(THING3));
     logln("Value now: %d\n", flags.getAll());
     flags.clear();
     logln("clear -Value now: %d\n", flags.getAll());
     logln("get(thing1)=%d, get(thing2)=%d, get(thing3)=%d\n",          flags.get(THING1),          flags.get(THING2),          flags.get(THING3));
-    TEST_ASSERT_TRUE(flags.get(THING1) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING2) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING3) == FALSE);
+    assertFalse(WHERE, flags.get(THING1));
+    assertFalse(WHERE, flags.get(THING2));
+    assertFalse(WHERE, flags.get(THING3));
     flags.add(THING1);
     logln("set THING1 -Value now: %d\n", flags.getAll());
-    TEST_ASSERT_TRUE(flags.get(THING1) == TRUE);
-    TEST_ASSERT_TRUE(flags.get(THING2) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING3) == FALSE);
+    assertTrue(WHERE, flags.get(THING1));
+    assertFalse(WHERE, flags.get(THING2));
+    assertFalse(WHERE, flags.get(THING3));
     logln("get(thing1)=%d, get(thing2)=%d, get(thing3)=%d\n",          flags.get(THING1),          flags.get(THING2),          flags.get(THING3));
     flags.add(THING3);
     logln("set THING3 -Value now: %d\n", flags.getAll());
-    TEST_ASSERT_TRUE(flags.get(THING1) == TRUE);
-    TEST_ASSERT_TRUE(flags.get(THING2) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING3) == TRUE);
+    assertTrue(WHERE, flags.get(THING1));
+    assertFalse(WHERE, flags.get(THING2));
+    assertTrue(WHERE, flags.get(THING3));
     logln("get(thing1)=%d, get(thing2)=%d, get(thing3)=%d\n",          flags.get(THING1),          flags.get(THING2),          flags.get(THING3));
     flags.remove(THING2);
-    TEST_ASSERT_TRUE(flags.get(THING1) == TRUE);
-    TEST_ASSERT_TRUE(flags.get(THING2) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING3) == TRUE);
+    assertTrue(WHERE, flags.get(THING1));
+    assertFalse(WHERE, flags.get(THING2));
+    assertTrue(WHERE, flags.get(THING3));
     logln("remove THING2 -Value now: %d\n", flags.getAll());
     logln("get(thing1)=%d, get(thing2)=%d, get(thing3)=%d\n",          flags.get(THING1),          flags.get(THING2),          flags.get(THING3));
     flags.remove(THING1);
-    TEST_ASSERT_TRUE(flags.get(THING1) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING2) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING3) == TRUE);
+    assertFalse(WHERE, flags.get(THING1));
+    assertFalse(WHERE, flags.get(THING2));
+    assertTrue(WHERE, flags.get(THING3));
     logln("remove THING1 -Value now: %d\n", flags.getAll());
     logln("get(thing1)=%d, get(thing2)=%d, get(thing3)=%d\n",          flags.get(THING1),          flags.get(THING2),          flags.get(THING3));
 
     flags.clear();
     logln("clear -Value now: %d\n", flags.getAll());
     logln("get(thing1)=%d, get(thing2)=%d, get(thing3)=%d\n",          flags.get(THING1),          flags.get(THING2),          flags.get(THING3));
-    TEST_ASSERT_TRUE(flags.get(THING1) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING2) == FALSE);
-    TEST_ASSERT_TRUE(flags.get(THING3) == FALSE);
+    assertFalse(WHERE, flags.get(THING1));
+    assertFalse(WHERE, flags.get(THING2));
+    assertFalse(WHERE, flags.get(THING3));
 }
index 8a88c59b2266a09e75db625a0175055c11a3dbfc..08b3c6af020ae9a97d52940356db41f96c9f2b03 100644 (file)
@@ -2327,7 +2327,7 @@ void LocaleTest::checkRegisteredCollators(const char *expectExtra) {
     int32_t count1=0,count2=0;
     Hashtable oldHash(status);
     Hashtable newHash(status);
-    TEST_ASSERT_STATUS(status);
+    assertSuccess(WHERE, status);
 
     UnicodeString expectStr(expectExtra?expectExtra:"n/a", "");
 
index 8d52dc122bf6ef087498c78ad4f9f1e998360946..fc3ca05652bdaab1887bd70f6194bbc1605fe044 100644 (file)
@@ -2195,7 +2195,7 @@ void NumberFormatTest::TestSymbolsWithBadLocale(void) {
     for (i = 0; i < UPRV_LENGTHOF(badLocales); i++) {
         const char *localeName = badLocales[i];
         Locale locBad(localeName);
-        TEST_ASSERT_TRUE(!locBad.isBogus());
+        assertTrue(WHERE, !locBad.isBogus());
         UErrorCode status = U_ZERO_ERROR;
         UnicodeString intlCurrencySymbol((UChar)0xa4);
 
index fa6ea066807a800caec4b46e7adeaedbae4c4c1c..5d8ea00fd982933169bc02d8019c57c32c86abaa 100644 (file)
@@ -1389,9 +1389,9 @@ void RBBIAPITest::TestFilteredBreakIteratorBuilder() {
       prtbrks(filteredBI.getAlias(), frText, *this);
 
       // Verify ==
-      TEST_ASSERT_TRUE(*frenchBI   == *frenchBI);
-      TEST_ASSERT_TRUE(*filteredBI != *frenchBI);
-      TEST_ASSERT_TRUE(*frenchBI   != *filteredBI);
+      assertTrue(WHERE, *frenchBI   == *frenchBI);
+      assertTrue(WHERE, *filteredBI != *frenchBI);
+      assertTrue(WHERE, *frenchBI   != *filteredBI);
     } else {
       dataerrln("French BI: not valid.");
        }
index 048e2bb8ed51cd8b0393a1106aa1adeb3c6f795b..5467a96b49950cc432e2f12846134eb11ddb05d7 100644 (file)
@@ -4356,13 +4356,6 @@ void RBBITest::TestEmoji() {
 
 // TestBug12519  -  Correct handling of Locales by assignment / copy / clone
 
-// WHERE Macro yields a literal string of the form "source_file_name:line number "
-// TODO: propose something equivalent as a test framework addition.
-
-#define WHERE __FILE__ ":" XLINE(__LINE__) " "
-#define XLINE(s) LINE(s)
-#define LINE(s) #s
-
 void RBBITest::TestBug12519() {
     UErrorCode status = U_ZERO_ERROR;
     LocalPointer<RuleBasedBreakIterator> biEn((RuleBasedBreakIterator *)BreakIterator::createWordInstance(Locale::getEnglish(), status));
index 57d72fb3f547d8758285792037b4ee4426dedd66..e33926101393acf6102152113124893b50e11d25 100644 (file)
@@ -2204,7 +2204,7 @@ UnicodeStringTest::TestUInt16Pointers() {
 
     UErrorCode errorCode = U_ZERO_ERROR;
     int32_t length = UnicodeString(u"def").extract(arr, 4, errorCode);
-    TEST_ASSERT_STATUS(errorCode);
+    assertSuccess(WHERE, errorCode);
     assertEquals("def from extract()", UnicodeString(u"def"), UnicodeString(arr, length));
 }
 
@@ -2226,7 +2226,7 @@ UnicodeStringTest::TestWCharPointers() {
 
     UErrorCode errorCode = U_ZERO_ERROR;
     int32_t length = UnicodeString(u"def").extract(arr, 4, errorCode);
-    TEST_ASSERT_STATUS(errorCode);
+    assertSuccess(WHERE, errorCode);
     assertEquals("def from extract()", UnicodeString(u"def"), UnicodeString(arr, length));
 #endif
 }