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

Unified Diff: source/test/intltest/citrtest.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/caltest.cpp ('k') | source/test/intltest/cntabcol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/intltest/citrtest.cpp
diff --git a/source/test/intltest/citrtest.cpp b/source/test/intltest/citrtest.cpp
index bc9d7439238dc3e4c818d339e186a5ecf5956d2a..80a0cf71042edaf6db23de2dc0b27d9d67a6dd9d 100644
--- a/source/test/intltest/citrtest.cpp
+++ b/source/test/intltest/citrtest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2012, International Business Machines Corporation and
+ * Copyright (c) 1997-2014, International Business Machines Corporation and
* others. All Rights Reserved.
* Modification History:
*
@@ -20,6 +20,7 @@
#include "unicode/putil.h"
#include "unicode/utf16.h"
#include "citrtest.h"
+#include "cmemory.h"
class SCharacterIterator : public CharacterIterator {
@@ -139,8 +140,6 @@ private:
};
const char SCharacterIterator::fgClassID=0;
-#define LENGTHOF(array) ((int32_t)(sizeof(array)/sizeof((array)[0])))
-
CharIterTest::CharIterTest()
{
}
@@ -967,7 +966,7 @@ class SubCharIter : public CharacterIterator {
public:
// public default constructor, to get coverage of CharacterIterator()
SubCharIter() : CharacterIterator() {
- textLength=end=LENGTHOF(s);
+ textLength=end=UPRV_LENGTHOF(s);
s[0]=0x61; // 'a'
s[1]=0xd900; // U+50400
s[2]=0xdd00;
@@ -976,7 +975,7 @@ public:
// useful stuff, mostly dummy but testing coverage and subclassability
virtual UChar nextPostInc() {
- if(pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s)) {
return s[pos++];
} else {
return DONE;
@@ -984,9 +983,9 @@ public:
}
virtual UChar32 next32PostInc() {
- if(pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s)) {
UChar32 c;
- U16_NEXT(s, pos, LENGTHOF(s), c);
+ U16_NEXT(s, pos, UPRV_LENGTHOF(s), c);
return c;
} else {
return DONE;
@@ -994,7 +993,7 @@ public:
}
virtual UBool hasNext() {
- return pos<LENGTHOF(s);
+ return pos<UPRV_LENGTHOF(s);
}
virtual UChar first() {
@@ -1005,15 +1004,15 @@ public:
virtual UChar32 first32() {
UChar32 c;
pos=0;
- U16_NEXT(s, pos, LENGTHOF(s), c);
+ U16_NEXT(s, pos, UPRV_LENGTHOF(s), c);
pos=0;
return c;
}
virtual UChar setIndex(int32_t position) {
- if(0<=position && position<=LENGTHOF(s)) {
+ if(0<=position && position<=UPRV_LENGTHOF(s)) {
pos=position;
- if(pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s)) {
return s[pos];
}
}
@@ -1021,11 +1020,11 @@ public:
}
virtual UChar32 setIndex32(int32_t position) {
- if(0<=position && position<=LENGTHOF(s)) {
+ if(0<=position && position<=UPRV_LENGTHOF(s)) {
pos=position;
- if(pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s)) {
UChar32 c;
- U16_GET(s, 0, pos, LENGTHOF(s), c);
+ U16_GET(s, 0, pos, UPRV_LENGTHOF(s), c);
return c;
}
}
@@ -1033,7 +1032,7 @@ public:
}
virtual UChar current() const {
- if(pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s)) {
return s[pos];
} else {
return DONE;
@@ -1041,9 +1040,9 @@ public:
}
virtual UChar32 current32() const {
- if(pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s)) {
UChar32 c;
- U16_GET(s, 0, pos, LENGTHOF(s), c);
+ U16_GET(s, 0, pos, UPRV_LENGTHOF(s), c);
return c;
} else {
return DONE;
@@ -1051,7 +1050,7 @@ public:
}
virtual UChar next() {
- if(pos<LENGTHOF(s) && ++pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s) && ++pos<UPRV_LENGTHOF(s)) {
return s[pos];
} else {
return DONE;
@@ -1059,13 +1058,13 @@ public:
}
virtual UChar32 next32() {
- if(pos<LENGTHOF(s)) {
- U16_FWD_1(s, pos, LENGTHOF(s));
+ if(pos<UPRV_LENGTHOF(s)) {
+ U16_FWD_1(s, pos, UPRV_LENGTHOF(s));
}
- if(pos<LENGTHOF(s)) {
+ if(pos<UPRV_LENGTHOF(s)) {
UChar32 c;
int32_t i=pos;
- U16_NEXT(s, i, LENGTHOF(s), c);
+ U16_NEXT(s, i, UPRV_LENGTHOF(s), c);
return c;
} else {
return DONE;
@@ -1077,7 +1076,7 @@ public:
}
virtual void getText(UnicodeString &result) {
- result.setTo(s, LENGTHOF(s));
+ result.setTo(s, UPRV_LENGTHOF(s));
}
// dummy implementations of other pure virtual base class functions
« no previous file with comments | « source/test/intltest/caltest.cpp ('k') | source/test/intltest/cntabcol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698