Index: source/test/cintltst/nucnvtst.c |
diff --git a/source/test/cintltst/nucnvtst.c b/source/test/cintltst/nucnvtst.c |
index f4a443cd9627b3d6c022da5ddb98fcf6c27ae6e1..5398cdeda68de0eb16987ad3484c4850b8b0b474 100644 |
--- a/source/test/cintltst/nucnvtst.c |
+++ b/source/test/cintltst/nucnvtst.c |
@@ -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. |
********************************************************************/ |
/******************************************************************************* |
@@ -26,8 +26,6 @@ |
#include "cmemory.h" |
#include "nucnvtst.h" |
-#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0])) |
- |
static void TestNextUChar(UConverter* cnv, const char* source, const char* limit, const int32_t results[], const char* message); |
static void TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErrorCode expected, const char* message); |
#if !UCONFIG_NO_COLLATION |
@@ -5397,6 +5395,12 @@ static void TestJitterbug981(){ |
} |
rules = ucol_getRules(myCollator, &rules_length); |
+ if(rules_length == 0) { |
+ log_data_err("missing zh tailoring rule string\n"); |
+ ucol_close(myCollator); |
+ ucnv_close(utf8cnv); |
+ return; |
+ } |
buff_size = rules_length * ucnv_getMaxCharSize(utf8cnv); |
buff = malloc(buff_size); |
@@ -5569,7 +5573,7 @@ TestIsFixedWidth() { |
"UTF16" |
}; |
- for (i = 0; i < LENGTHOF(fixedWidth); i++) { |
+ for (i = 0; i < UPRV_LENGTHOF(fixedWidth); i++) { |
cnv = ucnv_open(fixedWidth[i], &status); |
if (cnv == NULL || U_FAILURE(status)) { |
log_data_err("Error open converter: %s - %s \n", fixedWidth[i], u_errorName(status)); |
@@ -5582,7 +5586,7 @@ TestIsFixedWidth() { |
ucnv_close(cnv); |
} |
- for (i = 0; i < LENGTHOF(notFixedWidth); i++) { |
+ for (i = 0; i < UPRV_LENGTHOF(notFixedWidth); i++) { |
cnv = ucnv_open(notFixedWidth[i], &status); |
if (cnv == NULL || U_FAILURE(status)) { |
log_data_err("Error open converter: %s - %s \n", notFixedWidth[i], u_errorName(status)); |