]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/intltest/jamotest.cpp
ICU-57149.0.1.tar.gz
[apple/icu.git] / icuSources / test / intltest / jamotest.cpp
index 154d0857b44e7680cf82e9d14160b92af1beb906..65604c619203ca832b4466ee54639c8991820233 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************************
  * COPYRIGHT: 
- * Copyright (c) 1997-2008, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
  * others. All Rights Reserved.
  ********************************************************************
 ************************************************************************
@@ -16,6 +16,7 @@
 #include "jamotest.h"
 #include "unicode/utypes.h"
 #include "unicode/translit.h"
+#include "cmemory.h"
 #include "cpdtrans.h"
 
 // SEP is the disambiguation separator used by Latin-Jamo and Jamo-Latin
@@ -67,7 +68,7 @@ JamoTest::TestJamo() {
     Transliterator* latinJamo = Transliterator::createInstance("Latin-Jamo", UTRANS_FORWARD, parseError, status);
 
     if (latinJamo == 0 || U_FAILURE(status)) {
-        errln("FAIL: createInstance() returned 0");
+        dataerrln("FAIL: createInstance() returned 0 - %s", u_errorName(status));
         return;
     }
 
@@ -128,7 +129,7 @@ JamoTest::TestJamo() {
         "karka", "(Ki)(A)(L)(Ki)(A)", "kalka",
     };
 
-    enum { CASE_length = sizeof(CASE) / sizeof(CASE[0]) };
+    enum { CASE_length = UPRV_LENGTHOF(CASE) };
     
     int32_t i;
     for (i=0; i<CASE_length; i+=3) {
@@ -161,7 +162,7 @@ void JamoTest::TestPiecemeal(void) {
 
     t = Transliterator::createInstance("NFD", UTRANS_FORWARD, status); // was Hangul-Jamo
     if (U_FAILURE(status) || t == 0) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed");
         return;
     }
     expect(*t, hangul, jamo);
@@ -177,7 +178,7 @@ void JamoTest::TestPiecemeal(void) {
 
     t = Transliterator::createInstance("Latin-Jamo", UTRANS_FORWARD, status);
     if (U_FAILURE(status) || t == 0) {
-        errln("FAIL: createInstance failed");
+        dataerrln("FAIL: createInstance failed - %s", u_errorName(status));
         return;
     }
     expect(*t, latin, jamo);
@@ -367,7 +368,7 @@ JamoTest::TestRealText() {
       "\\ucc38\\uc870\\ud558\\uc2ed\\uc2dc\\uc624."
     };
 
-    enum { WHAT_IS_UNICODE_length = sizeof(WHAT_IS_UNICODE) / sizeof(WHAT_IS_UNICODE[0]) };
+    enum { WHAT_IS_UNICODE_length = UPRV_LENGTHOF(WHAT_IS_UNICODE) };
 
     UParseError parseError;
     UErrorCode status = U_ZERO_ERROR;
@@ -376,7 +377,7 @@ JamoTest::TestRealText() {
     if (latinJamo == 0 || jamoHangul == 0 || U_FAILURE(status)) {
         delete latinJamo;
         delete jamoHangul;
-        errln("FAIL: createInstance returned NULL");
+        dataerrln("FAIL: createInstance returned NULL - %s", u_errorName(status));
         return;
     }
     Transliterator* jamoLatin = latinJamo->createInverse(status);