Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: source/test/intltest/tstnorm.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/intltest/tsmthred.cpp ('k') | source/test/intltest/tufmtts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/intltest/tstnorm.cpp
diff --git a/source/test/intltest/tstnorm.cpp b/source/test/intltest/tstnorm.cpp
index cde6dbe88c77ab4a58fbae68a014d24ce2e69fb9..f9246198f7a8668086e2e4bb07c222a98de739e4 100644
--- a/source/test/intltest/tstnorm.cpp
+++ b/source/test/intltest/tstnorm.cpp
@@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2011, International Business Machines Corporation and
+ * Copyright (c) 1997-2014, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@@ -19,8 +19,7 @@
#include "normalizer2impl.h"
#include "tstnorm.h"
-#define LENGTHOF(array) ((int32_t)(sizeof(array)/sizeof((array)[0])))
-#define ARRAY_LENGTH(array) LENGTHOF(array)
+#define ARRAY_LENGTH(array) UPRV_LENGTHOF(array)
#define CASE(id,test) case id: \
name = #test; \
@@ -747,27 +746,27 @@ BasicNormalizerTest::TestPreviousNext() {
// for both sets of test data
static const char *const moves="0+0+0--0-0-+++0--+++++++0--------";
- TestPreviousNext(src, LENGTHOF(src),
- expect, LENGTHOF(expect),
+ TestPreviousNext(src, UPRV_LENGTHOF(src),
+ expect, UPRV_LENGTHOF(expect),
expectIndex,
SRC_MIDDLE, EXPECT_MIDDLE,
moves, UNORM_NFD, "basic");
- TestPreviousNext(src_j2911, LENGTHOF(src_j2911),
- expect_j2911, LENGTHOF(expect_j2911),
+ TestPreviousNext(src_j2911, UPRV_LENGTHOF(src_j2911),
+ expect_j2911, UPRV_LENGTHOF(expect_j2911),
expectIndex_j2911,
SRC_MIDDLE, EXPECT_MIDDLE,
moves, UNORM_NFKC, "j2911");
// try again from different "middle" indexes
- TestPreviousNext(src, LENGTHOF(src),
- expect, LENGTHOF(expect),
+ TestPreviousNext(src, UPRV_LENGTHOF(src),
+ expect, UPRV_LENGTHOF(expect),
expectIndex,
SRC_MIDDLE_2, EXPECT_MIDDLE_2,
moves, UNORM_NFD, "basic_2");
- TestPreviousNext(src_j2911, LENGTHOF(src_j2911),
- expect_j2911, LENGTHOF(expect_j2911),
+ TestPreviousNext(src_j2911, UPRV_LENGTHOF(src_j2911),
+ expect_j2911, UPRV_LENGTHOF(expect_j2911),
expectIndex_j2911,
SRC_MIDDLE_2, EXPECT_MIDDLE_2,
moves, UNORM_NFKC, "j2911_2");
@@ -1064,7 +1063,7 @@ BasicNormalizerTest::TestCompare() {
{ UNORM_UNICODE_3_2<<UNORM_COMPARE_NORM_OPTIONS_SHIFT, "Unicode 3.2" }
};
- int32_t i, j, k, count=LENGTHOF(strings);
+ int32_t i, j, k, count=UPRV_LENGTHOF(strings);
int32_t result, refResult;
UErrorCode errorCode;
@@ -1077,7 +1076,7 @@ BasicNormalizerTest::TestCompare() {
// test them each with each other
for(i=0; i<count; ++i) {
for(j=i; j<count; ++j) {
- for(k=0; k<LENGTHOF(opt); ++k) {
+ for(k=0; k<UPRV_LENGTHOF(opt); ++k) {
// test Normalizer::compare
errorCode=U_ZERO_ERROR;
result=_norm_compare(s[i], s[j], opt[k].options, errorCode);
@@ -1117,14 +1116,14 @@ BasicNormalizerTest::TestCompare() {
}
// collect all sets into one for contiguous output
- for(i=0; i<LENGTHOF(iI); ++i) {
+ for(i=0; i<UPRV_LENGTHOF(iI); ++i) {
if(nfcImpl->getCanonStartSet(iI[i], iSet)) {
set.addAll(iSet);
}
}
// test all of these precomposed characters
- const Normalizer2 *nfcNorm2=Normalizer2Factory::getNFCInstance(errorCode);
+ const Normalizer2 *nfcNorm2=Normalizer2::getNFCInstance(errorCode);
UnicodeSetIterator it(set);
while(it.next() && !it.isString()) {
UChar32 c=it.getCodepoint();
@@ -1134,7 +1133,7 @@ BasicNormalizerTest::TestCompare() {
}
s1.setTo(c);
- for(k=0; k<LENGTHOF(opt); ++k) {
+ for(k=0; k<UPRV_LENGTHOF(opt); ++k) {
// test Normalizer::compare
errorCode=U_ZERO_ERROR;
result=_norm_compare(s1, s2, opt[k].options, errorCode);
@@ -1438,7 +1437,7 @@ BasicNormalizerTest::TestCustomComp() {
if(errorCode.logDataIfFailureAndReset("unable to load testdata/testnorm.nrm")) {
return;
}
- for(int32_t i=0; i<LENGTHOF(pairs); ++i) {
+ for(int32_t i=0; i<UPRV_LENGTHOF(pairs); ++i) {
const StringPair &pair=pairs[i];
UnicodeString input=UnicodeString(pair.input, -1, US_INV).unescape();
UnicodeString expected=UnicodeString(pair.expected, -1, US_INV).unescape();
@@ -1470,7 +1469,7 @@ BasicNormalizerTest::TestCustomFCC() {
if(errorCode.logDataIfFailureAndReset("unable to load testdata/testnorm.nrm")) {
return;
}
- for(int32_t i=0; i<LENGTHOF(pairs); ++i) {
+ for(int32_t i=0; i<UPRV_LENGTHOF(pairs); ++i) {
const StringPair &pair=pairs[i];
UnicodeString input=UnicodeString(pair.input, -1, US_INV).unescape();
UnicodeString expected=UnicodeString(pair.expected, -1, US_INV).unescape();
@@ -1485,9 +1484,9 @@ BasicNormalizerTest::TestCustomFCC() {
void
BasicNormalizerTest::TestFilteredNormalizer2Coverage() {
UErrorCode errorCode = U_ZERO_ERROR;
- const Normalizer2 *nfcNorm2=Normalizer2Factory::getNFCInstance(errorCode);
+ const Normalizer2 *nfcNorm2=Normalizer2::getNFCInstance(errorCode);
if (U_FAILURE(errorCode)) {
- dataerrln("Normalizer2Factory::getNFCInstance() call failed - %s", u_errorName(status));
+ dataerrln("Normalizer2::getNFCInstance() call failed - %s", u_errorName(status));
return;
}
UnicodeSet filter(UNICODE_STRING_SIMPLE("[^\\u00a0-\\u00ff\\u0310-\\u031f]"), errorCode);
« no previous file with comments | « source/test/intltest/tsmthred.cpp ('k') | source/test/intltest/tufmtts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698