]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/srchtest.cpp
ICU-57131.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / srchtest.cpp
index a748ac707465a30a1b540022caa56b0a569c4005..e72f84aab23e2ebdc6b795ecdeaa0a10dc97e96f 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *****************************************************************************
-* Copyright (C) 2001-2011, International Business Machines orporation  
+* Copyright (C) 2001-2016, International Business Machines orporation  
 * and others. All Rights Reserved.
 ****************************************************************************/
 
@@ -15,6 +15,7 @@
 #include "unicode/stsearch.h"
 #include "unicode/ustring.h"
 #include "unicode/schriter.h"
+#include "cmemory.h"
 #include <string.h>
 #include <stdio.h>
 
@@ -2422,7 +2423,7 @@ void StringSearchTest::TestSubclass()
     search.reset();
     // comparing constructors
  
-    for (i = 0; i < (int)(sizeof(expected) / sizeof(expected[0])); i ++) {
+    for (i = 0; i < UPRV_LENGTHOF(expected); i ++) {
         if (search.next(status) != expected[i]) {
             errln("Error getting next match");
         }
@@ -2433,7 +2434,7 @@ void StringSearchTest::TestSubclass()
     if (search.next(status) != USEARCH_DONE) {
         errln("Error should have reached the end of the iteration");
     }
-    for (i = sizeof(expected) / sizeof(expected[0]) - 1; i >= 0; i --) {
+    for (i = UPRV_LENGTHOF(expected) - 1; i >= 0; i --) {
         if (search.previous(status) != expected[i]) {
             errln("Error getting previous match");
         }