X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/729e4ab9bc6618bc3d8a898e575df7f4019e29ca..f59164e3d128c7675a4d3934206346a3384e53a5:/icuSources/test/intltest/citrtest.cpp diff --git a/icuSources/test/intltest/citrtest.cpp b/icuSources/test/intltest/citrtest.cpp index 8f2059fb..80a0cf71 100644 --- a/icuSources/test/intltest/citrtest.cpp +++ b/icuSources/test/intltest/citrtest.cpp @@ -1,6 +1,6 @@ /**************************************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2010, International Business Machines Corporation and + * Copyright (c) 1997-2014, International Business Machines Corporation and * others. All Rights Reserved. * Modification History: * @@ -9,7 +9,7 @@ ****************************************************************************************/ #include -#include // for 'typeid' to work +#include "utypeinfo.h" // for 'typeid' to work #include "unicode/chariter.h" #include "unicode/ustring.h" @@ -18,7 +18,9 @@ #include "unicode/uchriter.h" #include "unicode/uiter.h" #include "unicode/putil.h" +#include "unicode/utf16.h" #include "citrtest.h" +#include "cmemory.h" class SCharacterIterator : public CharacterIterator { @@ -102,20 +104,20 @@ public: case kStart: pos = begin; if(delta > 0) { - UTF_FWD_N(text, pos, end, delta); + U16_FWD_N(text, pos, end, delta); } break; case kCurrent: if(delta > 0) { - UTF_FWD_N(text, pos, end, delta); + U16_FWD_N(text, pos, end, delta); } else { - UTF_BACK_N(text, begin, pos, -delta); + U16_BACK_N(text, begin, pos, -delta); } break; case kEnd: pos = end; if(delta < 0) { - UTF_BACK_N(text, begin, pos, -delta); + U16_BACK_N(text, begin, pos, -delta); } break; default: @@ -138,8 +140,6 @@ private: }; const char SCharacterIterator::fgClassID=0; -#define LENGTHOF(array) ((int32_t)(sizeof(array)/sizeof((array)[0]))) - CharIterTest::CharIterTest() { } @@ -666,7 +666,7 @@ void CharIterTest::TestIterationUChar32() { c=iter.first32PostInc(); if(c != text.char32At(i)) errln("first32PostInc failed. Expected->%X Got->%X", text.char32At(i), c); - if(iter.getIndex() != UTF16_CHAR_LENGTH(c) + i) + if(iter.getIndex() != U16_LENGTH(c) + i) errln((UnicodeString)"getIndex() after first32PostInc() failed"); iter.setToStart(); @@ -966,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; @@ -975,7 +975,7 @@ public: // useful stuff, mostly dummy but testing coverage and subclassability virtual UChar nextPostInc() { - if(pos