]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/currcoll.cpp
ICU-62107.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / currcoll.cpp
index df5a15f8fdacde7763f17e2b407f38131eb7dcfc..d82ec91b4769fa532d7207ca3c8ec21c77cc7e19 100644 (file)
@@ -1,6 +1,8 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2003, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************/
 
 #include "currcoll.h"
 #endif
 
+#include "cmemory.h"
 #include "sfwdchit.h"
 
-#define ARRAY_LENGTH(array) (sizeof array / sizeof array[0])
-
 CollationCurrencyTest::CollationCurrencyTest()
 {
 }
@@ -85,15 +86,15 @@ void CollationCurrencyTest::currencyTest(/*char *par*/)
 
     if (U_FAILURE(status))
     {
-        errln ("Collator::createInstance() failed!");
+        errcheckln (status, "Collator::createInstance() failed! - %s", u_errorName(status));
         return;
     }
 
     // Compare each currency symbol against all the
     // currency symbols, including itself
-    for (i = 0; i < ARRAY_LENGTH(currency); i += 1)
+    for (i = 0; i < UPRV_LENGTHOF(currency); i += 1)
     {
-        for (j = 0; j < ARRAY_LENGTH(currency); j += 1)
+        for (j = 0; j < UPRV_LENGTHOF(currency); j += 1)
         {
             UnicodeString source(currency[i], 1);
             UnicodeString target(currency[j], 1);