Index: source/test/intltest/plurults.cpp |
diff --git a/source/test/intltest/plurults.cpp b/source/test/intltest/plurults.cpp |
index 9f8346cb75653f32e28568f851c952cf4f3e422c..14e24191946d9035616f8aa314e6b5e06dab775b 100644 |
--- a/source/test/intltest/plurults.cpp |
+++ b/source/test/intltest/plurults.cpp |
@@ -1,6 +1,6 @@ |
/* |
******************************************************************************* |
-* Copyright (C) 2007-2013, International Business Machines Corporation and |
+* Copyright (C) 2007-2014, International Business Machines Corporation and |
* others. All Rights Reserved. |
******************************************************************************** |
@@ -27,8 +27,6 @@ |
#include "plurults.h" |
#include "uhash.h" |
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof(array[0])) |
- |
void setupResult(const int32_t testSource[], char result[], int32_t* max); |
UBool checkEqual(const PluralRules &test, char *result, int32_t max); |
UBool testEquality(const PluralRules &test); |
@@ -221,10 +219,10 @@ void PluralRulesTest::testAPI(/*char *par*/) |
} |
double fData[] = {-101, -100, -1, -0.0, 0, 0.1, 1, 1.999, 2.0, 100, 100.001 }; |
UBool isKeywordA[] = {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE }; |
- for (int32_t i=0; i<LENGTHOF(fData); i++) { |
+ for (int32_t i=0; i<UPRV_LENGTHOF(fData); i++) { |
if ((newRules->select(fData[i])== KEYWORD_A) != isKeywordA[i]) { |
errln("File %s, Line %d, ERROR: plural rules for decimal fractions test failed!\n" |
- " number = %g, expected %s", __FILE__, __LINE__, fData[i], isKeywordA?"TRUE":"FALSE"); |
+ " number = %g, expected %s", __FILE__, __LINE__, fData[i], isKeywordA[i]?"TRUE":"FALSE"); |
} |
} |
@@ -398,7 +396,7 @@ void PluralRulesTest::testGetSamples() { |
} |
const UnicodeString* keyword; |
while (NULL != (keyword = keywords->snext(status))) { |
- int32_t count = rules->getSamples(*keyword, values, LENGTHOF(values), status); |
+ int32_t count = rules->getSamples(*keyword, values, UPRV_LENGTHOF(values), status); |
if (U_FAILURE(status)) { |
errln(UNICODE_STRING_SIMPLE("getSamples() failed for locale ") + |
locales[i].getName() + |
@@ -409,12 +407,12 @@ void PluralRulesTest::testGetSamples() { |
// TODO: Lots of these. |
// errln(UNICODE_STRING_SIMPLE("no samples for keyword ") + *keyword + UNICODE_STRING_SIMPLE(" in locale ") + locales[i].getName() ); |
} |
- if (count > LENGTHOF(values)) { |
+ if (count > UPRV_LENGTHOF(values)) { |
errln(UNICODE_STRING_SIMPLE("getSamples()=") + count + |
UNICODE_STRING_SIMPLE(", too many values, for locale ") + |
locales[i].getName() + |
UNICODE_STRING_SIMPLE(", keyword ") + *keyword); |
- count = LENGTHOF(values); |
+ count = UPRV_LENGTHOF(values); |
} |
for (int32_t j = 0; j < count; ++j) { |
if (values[j] == UPLRULES_NO_UNIQUE_VALUE) { |
@@ -939,7 +937,7 @@ void PluralRulesTest::testParseErrors() { |
"a: n % 37 ! in 3..4" |
}; |
- for (int i=0; i<LENGTHOF(testCases); i++) { |
+ for (int i=0; i<UPRV_LENGTHOF(testCases); i++) { |
const char *rules = testCases[i]; |
UErrorCode status = U_ZERO_ERROR; |
PluralRules *pr = PluralRules::createRules(UnicodeString(rules), status); |
@@ -981,7 +979,7 @@ void PluralRulesTest::testFixedDecimal() { |
{100.0001234, 7, 1234} |
}; |
- for (int i=0; i<LENGTHOF(testCases); ++i) { |
+ for (int i=0; i<UPRV_LENGTHOF(testCases); ++i) { |
DoubleTestCase &tc = testCases[i]; |
int32_t numFractionDigits = FixedDecimal::decimals(tc.n); |
if (numFractionDigits != tc.fractionDigitCount) { |