X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b331163bffd790ced0e88b73f44f86d49ccc48a5..2ca993e82fb37b597a3c73ecd1586a139a6579c5:/icuSources/test/intltest/thcoll.cpp diff --git a/icuSources/test/intltest/thcoll.cpp b/icuSources/test/intltest/thcoll.cpp index 87fa4c89..fdc3ba05 100644 --- a/icuSources/test/intltest/thcoll.cpp +++ b/icuSources/test/intltest/thcoll.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 1999-2014, International Business Machines +* Copyright (C) 1999-2016, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description @@ -19,6 +19,7 @@ #include "unicode/sortkey.h" #include "unicode/tblcoll.h" #include "unicode/ustring.h" +#include "cmemory.h" #include "cstring.h" #include "filestrm.h" #include "textfile.h" @@ -239,7 +240,7 @@ void CollationThaiTest::TestCornerCases(void) { // Periods are ignored entirely "\\u0e01.\\u0e01.", "<", "\\u0e01\\u0e32", }; - const int32_t TESTS_length = (int32_t)(sizeof(TESTS)/sizeof(TESTS[0])); + const int32_t TESTS_length = UPRV_LENGTHOF(TESTS); if (coll == 0) { errln("Error: could not construct Thai collator"); @@ -376,7 +377,7 @@ void CollationThaiTest::TestInvalidThai(void) { CollationElementIterator* c = ((RuleBasedCollator *)coll)->createCollationElementIterator( iteratorText ); - for(i = 0; i < (int32_t)(sizeof(tests)/sizeof(tests[0])); i++) { + for(i = 0; i < UPRV_LENGTHOF(tests); i++) { len = u_unescape(tests[i], strings[i], 20); strings[i][len] = 0; toSort[i] = strings[i]; @@ -453,7 +454,7 @@ void CollationThaiTest::TestReordering(void) { errln("Unable to set the Thai collator clone to secondary strength"); return; } - compareArray(*coll2, tests, sizeof(tests)/sizeof(tests[0])); + compareArray(*coll2, tests, UPRV_LENGTHOF(tests)); const char *rule = "& c < ab"; const char *testcontraction[] = { "\\u0E41ab", ">", "\\u0E41c"}; // After UCA 4.1 Thai are normal so won't break a contraction