| Index: source/test/cintltst/ncnvtst.c
|
| diff --git a/source/test/cintltst/ncnvtst.c b/source/test/cintltst/ncnvtst.c
|
| index cfbeed82cd1dcc2b3a2956d9ca185a568ca3546c..210784b4987c5ba9e0bfd349559d3251ef484c55 100644
|
| --- a/source/test/cintltst/ncnvtst.c
|
| +++ b/source/test/cintltst/ncnvtst.c
|
| @@ -1,6 +1,6 @@
|
| /********************************************************************
|
| * COPYRIGHT:
|
| - * Copyright (c) 1997-2013, International Business Machines Corporation and
|
| + * Copyright (c) 1997-2014, International Business Machines Corporation and
|
| * others. All Rights Reserved.
|
| ********************************************************************/
|
| /*****************************************************************************
|
| @@ -21,6 +21,7 @@
|
| #include "unicode/ustring.h"
|
| #include "unicode/uset.h"
|
| #include "cintltst.h"
|
| +#include "cmemory.h"
|
|
|
| #define MAX_LENGTH 999
|
|
|
| @@ -33,7 +34,6 @@ static int32_t gOutBufferSize = 0;
|
| static char gNuConvTestName[1024];
|
|
|
| #define nct_min(x,y) ((x<y) ? x : y)
|
| -#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
|
|
|
| static void printSeq(const unsigned char* a, int len);
|
| static void printSeqErr(const unsigned char* a, int len);
|
| @@ -1792,7 +1792,7 @@ doTestTruncated(const char *cnvName, const uint8_t *bytes, int32_t length) {
|
| source=(const char *)bytes;
|
| sourceLimit=source+length;
|
| target=buffer;
|
| - targetLimit=buffer+LENGTHOF(buffer);
|
| + targetLimit=buffer+UPRV_LENGTHOF(buffer);
|
|
|
| /* 1. input bytes with flush=FALSE, then input nothing with flush=TRUE */
|
| ucnv_toUnicode(cnv, &target, targetLimit, &source, sourceLimit, NULL, FALSE, &errorCode);
|
| @@ -1866,7 +1866,7 @@ TestTruncated() {
|
| };
|
| int32_t i;
|
|
|
| - for(i=0; i<LENGTHOF(testCases); ++i) {
|
| + for(i=0; i<UPRV_LENGTHOF(testCases); ++i) {
|
| doTestTruncated(testCases[i].cnvName, testCases[i].bytes, testCases[i].length);
|
| }
|
| }
|
| @@ -1961,7 +1961,7 @@ TestUnicodeSet() {
|
| }
|
|
|
| /* test converters that are known to convert all of Unicode (except maybe for surrogates) */
|
| - for(i=0; i<LENGTHOF(completeSetNames); ++i) {
|
| + for(i=0; i<UPRV_LENGTHOF(completeSetNames); ++i) {
|
| errorCode=U_ZERO_ERROR;
|
| name=completeSetNames[i];
|
| cnv=ucnv_open(name, &errorCode);
|
| @@ -1985,7 +1985,7 @@ TestUnicodeSet() {
|
|
|
| #if !UCONFIG_NO_LEGACY_CONVERSION
|
| /* test LMBCS variants which convert all of Unicode except for U+F6xx */
|
| - for(i=0; i<LENGTHOF(lmbcsNames); ++i) {
|
| + for(i=0; i<UPRV_LENGTHOF(lmbcsNames); ++i) {
|
| errorCode=U_ZERO_ERROR;
|
| name=lmbcsNames[i];
|
| cnv=ucnv_open(name, &errorCode);
|
| @@ -2009,7 +2009,7 @@ TestUnicodeSet() {
|
| #endif
|
|
|
| /* test specific sets */
|
| - for(i=0; i<LENGTHOF(nameRanges); ++i) {
|
| + for(i=0; i<UPRV_LENGTHOF(nameRanges); ++i) {
|
| errorCode=U_ZERO_ERROR;
|
| name=nameRanges[i].name;
|
| cnv=ucnv_open(name, &errorCode);
|
|
|