#include "cstring.h"
#include "cwchar.h"
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
void addUCharTransformTest(TestNode** root);
static void Test_strToUTF32(void);
/* first with length */
u32DestLen = -2;
- u_strToUTF32(u32Target, 0, &u32DestLen, src16, LENGTHOF(src16),&err);
- if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != LENGTHOF(src32)) {
+ u_strToUTF32(u32Target, 0, &u32DestLen, src16, UPRV_LENGTHOF(src16),&err);
+ if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != UPRV_LENGTHOF(src32)) {
log_err("u_strToUTF32(preflight with length): "
"length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
- (long)u32DestLen, (long)LENGTHOF(src32), u_errorName(err));
+ (long)u32DestLen, (long)UPRV_LENGTHOF(src32), u_errorName(err));
return;
}
err = U_ZERO_ERROR;
u32DestLen = -2;
- u_strToUTF32(u32Target, LENGTHOF(src32)+1, &u32DestLen, src16, LENGTHOF(src16),&err);
- if(err != U_ZERO_ERROR || u32DestLen != LENGTHOF(src32)) {
+ u_strToUTF32(u32Target, UPRV_LENGTHOF(src32)+1, &u32DestLen, src16, UPRV_LENGTHOF(src16),&err);
+ if(err != U_ZERO_ERROR || u32DestLen != UPRV_LENGTHOF(src32)) {
log_err("u_strToUTF32(with length): "
"length %ld != %ld and %s != U_ZERO_ERROR\n",
- (long)u32DestLen, (long)LENGTHOF(src32), u_errorName(err));
+ (long)u32DestLen, (long)UPRV_LENGTHOF(src32), u_errorName(err));
return;
}
/*for(i=0; i< u32DestLen; i++){
printf("\n");
}
}*/
- for(i=0; i< LENGTHOF(src32); i++){
+ for(i=0; i< UPRV_LENGTHOF(src32); i++){
if(u32Target[i] != src32[i]){
log_verbose("u_strToUTF32(with length) failed expected: %04X got: %04X at index: %i \n", src32[i], u32Target[i],i);
}
/* now NUL-terminated */
u32DestLen = -2;
u_strToUTF32(NULL,0, &u32DestLen, src16, -1,&err);
- if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != LENGTHOF(src32)-1) {
+ if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != UPRV_LENGTHOF(src32)-1) {
log_err("u_strToUTF32(preflight with NUL-termination): "
"length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
- (long)u32DestLen, (long)LENGTHOF(src32)-1, u_errorName(err));
+ (long)u32DestLen, (long)UPRV_LENGTHOF(src32)-1, u_errorName(err));
return;
}
err = U_ZERO_ERROR;
u32DestLen = -2;
- u_strToUTF32(u32Target, LENGTHOF(src32), &u32DestLen, src16, -1,&err);
- if(err != U_ZERO_ERROR || u32DestLen != LENGTHOF(src32)-1) {
+ u_strToUTF32(u32Target, UPRV_LENGTHOF(src32), &u32DestLen, src16, -1,&err);
+ if(err != U_ZERO_ERROR || u32DestLen != UPRV_LENGTHOF(src32)-1) {
log_err("u_strToUTF32(with NUL-termination): "
"length %ld != %ld and %s != U_ZERO_ERROR\n",
- (long)u32DestLen, (long)LENGTHOF(src32)-1, u_errorName(err));
+ (long)u32DestLen, (long)UPRV_LENGTHOF(src32)-1, u_errorName(err));
return;
}
- for(i=0; i< LENGTHOF(src32); i++){
+ for(i=0; i< UPRV_LENGTHOF(src32); i++){
if(u32Target[i] != src32[i]){
log_verbose("u_strToUTF32(NUL-termination) failed expected: %04X got: %04X \n", src32[i], u32Target[i]);
}
static const UChar32 expected[] = { 0x5a, 0x50000, 0x7a, 0 };
static const UChar32 expected_FFFD[] = { 0x41, 0xfffd, 0x61, 0xfffd, 0x5a, 0x50000, 0x7a, 0 };
static const UChar32 expected_12345[] = { 0x41, 0x12345, 0x61, 0x12345, 0x5a, 0x50000, 0x7a, 0 };
- len16 = LENGTHOF(surr16);
+ len16 = UPRV_LENGTHOF(surr16);
for(i = 0; i < 4; ++i) {
err = U_ZERO_ERROR;
u_strToUTF32(u32Target, 0, &u32DestLen, surr16+i, len16-i, &err);
}
err = U_ZERO_ERROR;
- u_strToUTF32(u32Target, LENGTHOF(u32Target), &u32DestLen, surr16+i, len16-i, &err);
+ u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+i, len16-i, &err);
if(err != U_INVALID_CHAR_FOUND) {
log_err("u_strToUTF32(surr16+%ld) sets %s != U_INVALID_CHAR_FOUND\n",
(long)i, u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strToUTF32(u32Target, LENGTHOF(u32Target), &u32DestLen, surr16+i, -1, &err);
+ u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+i, -1, &err);
if(err != U_INVALID_CHAR_FOUND) {
log_err("u_strToUTF32(surr16+%ld/NUL) sets %s != U_INVALID_CHAR_FOUND\n",
(long)i, u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strToUTF32(u32Target, LENGTHOF(u32Target), &u32DestLen, surr16+4, len16-4-1, &err);
+ u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+4, len16-4-1, &err);
if(err != U_ZERO_ERROR || u32DestLen != 3 || uprv_memcmp(u32Target, expected, 4*4)) {
log_err("u_strToUTF32(surr16+4) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strToUTF32(u32Target, LENGTHOF(u32Target), &u32DestLen, surr16+4, -1, &err);
+ u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+4, -1, &err);
if(err != U_ZERO_ERROR || u32DestLen != 3 || uprv_memcmp(u32Target, expected, 4*4)) {
log_err("u_strToUTF32(surr16+4/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strToUTF32WithSub(u32Target, LENGTHOF(u32Target), &u32DestLen, surr16, len16-1, 0xfffd, &numSubstitutions, &err);
+ u_strToUTF32WithSub(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16, len16-1, 0xfffd, &numSubstitutions, &err);
if(err != U_ZERO_ERROR || u32DestLen != 7 || numSubstitutions != 2 || uprv_memcmp(u32Target, expected_FFFD, 8*4)) {
log_err("u_strToUTF32WithSub(surr16) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strToUTF32WithSub(u32Target, LENGTHOF(u32Target), &u32DestLen, surr16, -1, 0x12345, &numSubstitutions, &err);
+ u_strToUTF32WithSub(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16, -1, 0x12345, &numSubstitutions, &err);
if(err != U_ZERO_ERROR || u32DestLen != 7 || numSubstitutions != 2 || uprv_memcmp(u32Target, expected_12345, 8*4)) {
log_err("u_strToUTF32WithSub(surr16/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
/* first with length */
uDestLen = -2;
- u_strFromUTF32(uTarget,0,&uDestLen,src32,LENGTHOF(src32),&err);
- if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != LENGTHOF(src16)) {
+ u_strFromUTF32(uTarget,0,&uDestLen,src32,UPRV_LENGTHOF(src32),&err);
+ if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != UPRV_LENGTHOF(src16)) {
log_err("u_strFromUTF32(preflight with length): "
"length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
- (long)uDestLen, (long)LENGTHOF(src16), u_errorName(err));
+ (long)uDestLen, (long)UPRV_LENGTHOF(src16), u_errorName(err));
return;
}
err = U_ZERO_ERROR;
uDestLen = -2;
- u_strFromUTF32(uTarget, LENGTHOF(src16)+1,&uDestLen,src32,LENGTHOF(src32),&err);
- if(err != U_ZERO_ERROR || uDestLen != LENGTHOF(src16)) {
+ u_strFromUTF32(uTarget, UPRV_LENGTHOF(src16)+1,&uDestLen,src32,UPRV_LENGTHOF(src32),&err);
+ if(err != U_ZERO_ERROR || uDestLen != UPRV_LENGTHOF(src16)) {
log_err("u_strFromUTF32(with length): "
"length %ld != %ld and %s != U_ZERO_ERROR\n",
- (long)uDestLen, (long)LENGTHOF(src16), u_errorName(err));
+ (long)uDestLen, (long)UPRV_LENGTHOF(src16), u_errorName(err));
return;
}
/*for(i=0; i< uDestLen; i++){
/* now NUL-terminated */
uDestLen = -2;
u_strFromUTF32(NULL,0,&uDestLen,src32,-1,&err);
- if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != LENGTHOF(src16)-1) {
+ if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != UPRV_LENGTHOF(src16)-1) {
log_err("u_strFromUTF32(preflight with NUL-termination): "
"length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
- (long)uDestLen, (long)LENGTHOF(src16)-1, u_errorName(err));
+ (long)uDestLen, (long)UPRV_LENGTHOF(src16)-1, u_errorName(err));
return;
}
err = U_ZERO_ERROR;
uDestLen = -2;
- u_strFromUTF32(uTarget, LENGTHOF(src16),&uDestLen,src32,-1,&err);
- if(err != U_ZERO_ERROR || uDestLen != LENGTHOF(src16)-1) {
+ u_strFromUTF32(uTarget, UPRV_LENGTHOF(src16),&uDestLen,src32,-1,&err);
+ if(err != U_ZERO_ERROR || uDestLen != UPRV_LENGTHOF(src16)-1) {
log_err("u_strFromUTF32(with NUL-termination): "
"length %ld != %ld and %s != U_ZERO_ERROR\n",
- (long)uDestLen, (long)LENGTHOF(src16)-1, u_errorName(err));
+ (long)uDestLen, (long)UPRV_LENGTHOF(src16)-1, u_errorName(err));
return;
}
static const UChar expected_FFFD[] = { 0x41, 0xfffd, 0x61, 0xfffd, 0xfffd, 0xfffd, 0x5a, 0xd900, 0xdc00, 0x7a, 0 };
static const UChar expected_12345[] = { 0x41, 0xd808, 0xdf45, 0x61, 0xd808, 0xdf45, 0xd808, 0xdf45, 0xd808, 0xdf45,
0x5a, 0xd900, 0xdc00, 0x7a, 0 };
- len32 = LENGTHOF(surr32);
+ len32 = UPRV_LENGTHOF(surr32);
for(i = 0; i < 6; ++i) {
err = U_ZERO_ERROR;
u_strFromUTF32(uTarget, 0, &uDestLen, surr32+i, len32-i, &err);
}
err = U_ZERO_ERROR;
- u_strFromUTF32(uTarget, LENGTHOF(uTarget), &uDestLen, surr32+i, len32-i, &err);
+ u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+i, len32-i, &err);
if(err != U_INVALID_CHAR_FOUND) {
log_err("u_strFromUTF32(surr32+%ld) sets %s != U_INVALID_CHAR_FOUND\n",
(long)i, u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strFromUTF32(uTarget, LENGTHOF(uTarget), &uDestLen, surr32+i, -1, &err);
+ u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+i, -1, &err);
if(err != U_INVALID_CHAR_FOUND) {
log_err("u_strFromUTF32(surr32+%ld/NUL) sets %s != U_INVALID_CHAR_FOUND\n",
(long)i, u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strFromUTF32(uTarget, LENGTHOF(uTarget), &uDestLen, surr32+6, len32-6-1, &err);
+ u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+6, len32-6-1, &err);
if(err != U_ZERO_ERROR || uDestLen != 4 || u_memcmp(uTarget, expected, 5)) {
log_err("u_strFromUTF32(surr32+6) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strFromUTF32(uTarget, LENGTHOF(uTarget), &uDestLen, surr32+6, -1, &err);
+ u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+6, -1, &err);
if(err != U_ZERO_ERROR || uDestLen != 4 || u_memcmp(uTarget, expected, 5)) {
log_err("u_strFromUTF32(surr32+6/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strFromUTF32WithSub(uTarget, LENGTHOF(uTarget), &uDestLen, surr32, len32-1, 0xfffd, &numSubstitutions, &err);
+ u_strFromUTF32WithSub(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32, len32-1, 0xfffd, &numSubstitutions, &err);
if(err != U_ZERO_ERROR || uDestLen != 10 || numSubstitutions != 4 || u_memcmp(uTarget, expected_FFFD, 11)) {
log_err("u_strFromUTF32WithSub(surr32) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
}
err = U_ZERO_ERROR;
- u_strFromUTF32WithSub(uTarget, LENGTHOF(uTarget), &uDestLen, surr32, -1, 0x12345, &numSubstitutions, &err);
+ u_strFromUTF32WithSub(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32, -1, 0x12345, &numSubstitutions, &err);
if(err != U_ZERO_ERROR || uDestLen != 14 || numSubstitutions != 4 || u_memcmp(uTarget, expected_12345, 15)) {
log_err("u_strFromUTF32WithSub(surr32/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
u_errorName(err));
char out8[10];
if(
- (err=U_ZERO_ERROR, u_strToUTF8(out8, LENGTHOF(out8), NULL, withLead16, LENGTHOF(withLead16), &err), err!=U_INVALID_CHAR_FOUND) ||
- (err=U_ZERO_ERROR, u_strToUTF8(out8, LENGTHOF(out8), NULL, withTrail16, -1, &err), err!=U_INVALID_CHAR_FOUND) ||
- (err=U_ZERO_ERROR, u_strFromUTF8(out16, LENGTHOF(out16), NULL, (const char *)withLead8, LENGTHOF(withLead8), &err), err!=U_INVALID_CHAR_FOUND) ||
- (err=U_ZERO_ERROR, u_strFromUTF8(out16, LENGTHOF(out16), NULL, (const char *)withTrail8, -1, &err), err!=U_INVALID_CHAR_FOUND)
+ (err=U_ZERO_ERROR, u_strToUTF8(out8, UPRV_LENGTHOF(out8), NULL, withLead16, UPRV_LENGTHOF(withLead16), &err), err!=U_INVALID_CHAR_FOUND) ||
+ (err=U_ZERO_ERROR, u_strToUTF8(out8, UPRV_LENGTHOF(out8), NULL, withTrail16, -1, &err), err!=U_INVALID_CHAR_FOUND) ||
+ (err=U_ZERO_ERROR, u_strFromUTF8(out16, UPRV_LENGTHOF(out16), NULL, (const char *)withLead8, UPRV_LENGTHOF(withLead8), &err), err!=U_INVALID_CHAR_FOUND) ||
+ (err=U_ZERO_ERROR, u_strFromUTF8(out16, UPRV_LENGTHOF(out16), NULL, (const char *)withTrail8, -1, &err), err!=U_INVALID_CHAR_FOUND)
) {
log_err("error: u_strTo/FromUTF8(string with single surrogate) fails to report error\n");
}
numSubstitutions=-1;
out16[0]=0x55aa;
uDestLen=0;
- u_strFromUTF8WithSub(out16, LENGTHOF(out16), &uDestLen,
+ u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
(const char *)withTrail8, uprv_strlen((const char *)withTrail8),
0x50005, &numSubstitutions,
&err);
numSubstitutions=-1;
out16[0]=0x55aa;
uDestLen=0;
- u_strFromUTF8WithSub(out16, LENGTHOF(out16), &uDestLen,
+ u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
(const char *)withTrail8, -1,
0xfffd, &numSubstitutions,
&err);
numSubstitutions=-1;
out8[0]=(char)0xf5;
u8DestLen=0;
- u_strToUTF8WithSub(out8, LENGTHOF(out8), &u8DestLen,
+ u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
withTrail16, u_strlen(withTrail16),
0xfffd, &numSubstitutions,
&err);
numSubstitutions=-1;
out8[0]=(char)0xf5;
u8DestLen=0;
- u_strToUTF8WithSub(out8, LENGTHOF(out8), &u8DestLen,
+ u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
withTrail16, -1,
0x1a, &numSubstitutions,
&err);
numSubstitutions=-1;
out16[0]=0x55aa;
uDestLen=0;
- u_strFromUTF8WithSub(out16, LENGTHOF(out16), &uDestLen,
+ u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
(const char *)withTrail8, 3,
0x50005, &numSubstitutions,
&err);
numSubstitutions=-1;
out8[0]=(char)0xf5;
u8DestLen=0;
- u_strToUTF8WithSub(out8, LENGTHOF(out8), &u8DestLen,
+ u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
withTrail16, 1,
0xfffd, &numSubstitutions,
&err);
numSubstitutions=-1;
out16[0]=0x55aa;
uDestLen=0;
- u_strFromUTF8WithSub(out16, LENGTHOF(out16), &uDestLen,
+ u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
(const char *)withTrail8, 3,
U_SENTINEL, &numSubstitutions,
&err);
numSubstitutions=-1;
out8[0]=(char)0xf5;
u8DestLen=0;
- u_strToUTF8WithSub(out8, LENGTHOF(out8), &u8DestLen,
+ u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
withTrail16, 1,
U_SENTINEL, &numSubstitutions,
&err);
static const char src[1]={ (char)0xf8 };
UChar out16[10];
err=U_ZERO_ERROR;
- u_strFromUTF8(out16, LENGTHOF(out16), NULL, src, 1, &err);
+ u_strFromUTF8(out16, UPRV_LENGTHOF(out16), NULL, src, 1, &err);
if(err!=U_INVALID_CHAR_FOUND) {
log_err("error: u_strFromUTF8(5-byte lead byte) failed\n");
}
errorCode=U_ZERO_ERROR;
dest[0]=dest[1]=99;
destLength=-99;
- destPointer=u_strFromUTF8(dest, LENGTHOF(dest), &destLength, (const char *)bytes, 3, &errorCode);
+ destPointer=u_strFromUTF8(dest, UPRV_LENGTHOF(dest), &destLength, (const char *)bytes, 3, &errorCode);
if(U_FAILURE(errorCode) || destPointer!=dest || destLength!=1 || dest[0]!=0x95c || dest[1]!=0) {
log_err("error: u_strFromUTF8(transform srcLength=3) fails: destLength=%ld - %s\n",
(long)destLength, u_errorName(errorCode));
dest[0]=dest[destLength0]=0x1234;
destLength=-1;
errorCode=U_ZERO_ERROR;
- pDest=u_strFromUTF8Lenient(dest, LENGTHOF(dest), &destLength, pb, -1, &errorCode);
+ pDest=u_strFromUTF8Lenient(dest, UPRV_LENGTHOF(dest), &destLength, pb, -1, &errorCode);
if (errorCode!=U_ZERO_ERROR ||
pDest!=dest || dest[destLength0]!=0 ||
destLength!=destLength0 || !equalAnyFFFD(dest, pu, destLength)
dest[0]=dest[destLength0]=0x1234;
destLength=-1;
errorCode=U_ZERO_ERROR;
- pDest=u_strFromUTF8Lenient(dest, LENGTHOF(dest), &destLength, pb, srcLength, &errorCode);
+ pDest=u_strFromUTF8Lenient(dest, UPRV_LENGTHOF(dest), &destLength, pb, srcLength, &errorCode);
if (errorCode!=U_ZERO_ERROR ||
pDest!=dest || dest[destLength0]!=0 ||
destLength!=destLength0 || !equalAnyFFFD(dest, pu, destLength)
err=U_ZERO_ERROR;
buffer[3]=0x20ac;
- wDestLen=u_terminateWChars(buffer, LENGTHOF(buffer), 3, &err);
+ wDestLen=u_terminateWChars(buffer, UPRV_LENGTHOF(buffer), 3, &err);
if(err!=U_ZERO_ERROR || wDestLen!=3 || buffer[3]!=0) {
log_err("u_terminateWChars(buffer, all, 3, zero) failed: %s length %d [3]==U+%04x\n",
u_errorName(err), wDestLen, buffer[3]);
err=U_STRING_NOT_TERMINATED_WARNING;
buffer[3]=0x20ac;
- wDestLen=u_terminateWChars(buffer, LENGTHOF(buffer), 3, &err);
+ wDestLen=u_terminateWChars(buffer, UPRV_LENGTHOF(buffer), 3, &err);
if(err!=U_ZERO_ERROR || wDestLen!=3 || buffer[3]!=0) {
log_err("u_terminateWChars(buffer, all, 3, not-terminated) failed: %s length %d [3]==U+%04x\n",
u_errorName(err), wDestLen, buffer[3]);
errorCode=U_ZERO_ERROR;
length=-5;
p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), &length,
- src, LENGTHOF(src), &errorCode);
+ src, UPRV_LENGTHOF(src), &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
+ length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
dest[length]!=0
) {
log_err("u_strToJavaModifiedUTF8(normal) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=-5;
p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), NULL,
- src, LENGTHOF(src), &errorCode);
+ src, UPRV_LENGTHOF(src), &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- 0!=memcmp(dest, expected, LENGTHOF(expected)) ||
- dest[LENGTHOF(expected)]!=0
+ 0!=memcmp(dest, expected, UPRV_LENGTHOF(expected)) ||
+ dest[UPRV_LENGTHOF(expected)]!=0
) {
log_err("u_strToJavaModifiedUTF8(normal, pLength=NULL) failed - %s\n", u_errorName(errorCode));
}
memset(dest, 0xff, sizeof(dest));
errorCode=U_ZERO_ERROR;
length=-5;
- p=u_strToJavaModifiedUTF8(dest, LENGTHOF(expected), &length,
- src, LENGTHOF(src), &errorCode);
+ p=u_strToJavaModifiedUTF8(dest, UPRV_LENGTHOF(expected), &length,
+ src, UPRV_LENGTHOF(src), &errorCode);
if( errorCode!=U_STRING_NOT_TERMINATED_WARNING || p!=dest ||
- length!=LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
+ length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
dest[length]!=(char)0xff
) {
log_err("u_strToJavaModifiedUTF8(tight) failed - %s\n", u_errorName(errorCode));
memset(dest, 0xff, sizeof(dest));
errorCode=U_ZERO_ERROR;
length=-5;
- p=u_strToJavaModifiedUTF8(dest, LENGTHOF(expected)/2, &length,
- src, LENGTHOF(src), &errorCode);
+ p=u_strToJavaModifiedUTF8(dest, UPRV_LENGTHOF(expected)/2, &length,
+ src, UPRV_LENGTHOF(src), &errorCode);
if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
- length!=LENGTHOF(expected) || dest[LENGTHOF(expected)/2]!=(char)0xff
+ length!=UPRV_LENGTHOF(expected) || dest[UPRV_LENGTHOF(expected)/2]!=(char)0xff
) {
log_err("u_strToJavaModifiedUTF8(overflow) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=-5;
p=u_strToJavaModifiedUTF8(NULL, 0, &length,
- src, LENGTHOF(src), &errorCode);
+ src, UPRV_LENGTHOF(src), &errorCode);
if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
- length!=LENGTHOF(expected) || dest[0]!=(char)0xff
+ length!=UPRV_LENGTHOF(expected) || dest[0]!=(char)0xff
) {
log_err("u_strToJavaModifiedUTF8(pure preflighting) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=-5;
p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), &length,
- shortSrc, LENGTHOF(shortSrc), &errorCode);
+ shortSrc, UPRV_LENGTHOF(shortSrc), &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
+ length!=UPRV_LENGTHOF(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
dest[length]!=0
) {
log_err("u_strToJavaModifiedUTF8(short) failed - %s\n", u_errorName(errorCode));
p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), &length,
asciiNul, -1, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
+ length!=UPRV_LENGTHOF(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
dest[length]!=0
) {
log_err("u_strToJavaModifiedUTF8(asciiNul) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=-5;
p=u_strToJavaModifiedUTF8(NULL, sizeof(dest), &length,
- src, LENGTHOF(src), &errorCode);
+ src, UPRV_LENGTHOF(src), &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=(char)0xff) {
log_err("u_strToJavaModifiedUTF8(dest=NULL) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=-5;
p=u_strToJavaModifiedUTF8(dest, -1, &length,
- src, LENGTHOF(src), &errorCode);
+ src, UPRV_LENGTHOF(src), &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=(char)0xff) {
log_err("u_strToJavaModifiedUTF8(destCapacity<0) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=-5;
p=u_strToJavaModifiedUTF8(dest, sizeof(dest), &length,
- NULL, LENGTHOF(src), &errorCode);
+ NULL, UPRV_LENGTHOF(src), &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=(char)0xff) {
log_err("u_strToJavaModifiedUTF8(src=NULL) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
+ length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
dest[length]!=0 ||
- numSubstitutions!=LENGTHOF(invalidExpectedFFFD)
+ numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
) {
log_err("u_strFromJavaModifiedUTF8WithSub(normal) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), NULL,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- 0!=memcmp(dest, expected, LENGTHOF(expected)) ||
- dest[LENGTHOF(expected)]!=0 ||
- numSubstitutions!=LENGTHOF(invalidExpectedFFFD)
+ 0!=memcmp(dest, expected, UPRV_LENGTHOF(expected)) ||
+ dest[UPRV_LENGTHOF(expected)]!=0 ||
+ numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
) {
log_err("u_strFromJavaModifiedUTF8WithSub(normal, pLength=NULL) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, NULL, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
+ length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
dest[length]!=0
) {
log_err("u_strFromJavaModifiedUTF8WithSub(normal, pNumSubstitutions=NULL) failed - %s\n", u_errorName(errorCode));
memset(dest, 0xff, sizeof(dest));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
- p=u_strFromJavaModifiedUTF8WithSub(dest, LENGTHOF(expected), &length,
- (const char *)src, LENGTHOF(src),
+ p=u_strFromJavaModifiedUTF8WithSub(dest, UPRV_LENGTHOF(expected), &length,
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if( errorCode!=U_STRING_NOT_TERMINATED_WARNING || p!=dest ||
- length!=LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
+ length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
dest[length]!=0xffff ||
- numSubstitutions!=LENGTHOF(invalidExpectedFFFD)
+ numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
) {
log_err("u_strFromJavaModifiedUTF8WithSub(tight) failed - %s\n", u_errorName(errorCode));
}
memset(dest, 0xff, sizeof(dest));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
- p=u_strFromJavaModifiedUTF8WithSub(dest, LENGTHOF(expected)/2, &length,
- (const char *)src, LENGTHOF(src),
+ p=u_strFromJavaModifiedUTF8WithSub(dest, UPRV_LENGTHOF(expected)/2, &length,
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
- length!=LENGTHOF(expected) || dest[LENGTHOF(expected)/2]!=0xffff
+ length!=UPRV_LENGTHOF(expected) || dest[UPRV_LENGTHOF(expected)/2]!=0xffff
) {
log_err("u_strFromJavaModifiedUTF8WithSub(overflow) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(NULL, 0, &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
- length!=LENGTHOF(expected) || dest[0]!=0xffff
+ length!=UPRV_LENGTHOF(expected) || dest[0]!=0xffff
) {
log_err("u_strFromJavaModifiedUTF8WithSub(pure preflighting) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
- (const char *)shortSrc, LENGTHOF(shortSrc),
+ (const char *)shortSrc, UPRV_LENGTHOF(shortSrc),
0xfffd, &numSubstitutions, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
+ length!=UPRV_LENGTHOF(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
dest[length]!=0 ||
numSubstitutions!=0
) {
(const char *)asciiNul, -1,
0xfffd, &numSubstitutions, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
+ length!=UPRV_LENGTHOF(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
dest[length]!=0 ||
numSubstitutions!=0
) {
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
- (const char *)invalid, LENGTHOF(invalid),
+ (const char *)invalid, UPRV_LENGTHOF(invalid),
0xfffd, &numSubstitutions, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(invalidExpectedFFFD) || 0!=memcmp(dest, invalidExpectedFFFD, length) ||
+ length!=UPRV_LENGTHOF(invalidExpectedFFFD) || 0!=memcmp(dest, invalidExpectedFFFD, length) ||
dest[length]!=0 ||
- numSubstitutions!=LENGTHOF(invalidExpectedFFFD)
+ numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
) {
log_err("u_strFromJavaModifiedUTF8WithSub(invalid->fffd) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
- (const char *)invalid, LENGTHOF(invalid),
+ (const char *)invalid, UPRV_LENGTHOF(invalid),
0x50000, &numSubstitutions, &errorCode);
if( U_FAILURE(errorCode) || p!=dest ||
- length!=LENGTHOF(invalidExpected50000) || 0!=memcmp(dest, invalidExpected50000, length) ||
+ length!=UPRV_LENGTHOF(invalidExpected50000) || 0!=memcmp(dest, invalidExpected50000, length) ||
dest[length]!=0 ||
- numSubstitutions!=LENGTHOF(invalidExpectedFFFD) /* not ...50000 */
+ numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD) /* not ...50000 */
) {
log_err("u_strFromJavaModifiedUTF8WithSub(invalid->50000) failed - %s\n", u_errorName(errorCode));
}
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
- (const char *)invalid, LENGTHOF(invalid),
+ (const char *)invalid, UPRV_LENGTHOF(invalid),
U_SENTINEL, &numSubstitutions, &errorCode);
if(errorCode!=U_INVALID_CHAR_FOUND || dest[0]!=0xffff || numSubstitutions!=0) {
log_err("u_strFromJavaModifiedUTF8WithSub(invalid->error) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
U_SENTINEL, &numSubstitutions, &errorCode);
if( errorCode!=U_INVALID_CHAR_FOUND ||
- length>=LENGTHOF(expected) || dest[LENGTHOF(expected)-1]!=0xffff ||
+ length>=UPRV_LENGTHOF(expected) || dest[UPRV_LENGTHOF(expected)-1]!=0xffff ||
numSubstitutions!=0
) {
log_err("u_strFromJavaModifiedUTF8WithSub(normal->error) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(NULL, sizeof(dest), &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
log_err("u_strFromJavaModifiedUTF8WithSub(dest=NULL) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, -1, &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
log_err("u_strFromJavaModifiedUTF8WithSub(destCapacity<0) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, sizeof(dest), &length,
- NULL, LENGTHOF(src),
+ NULL, UPRV_LENGTHOF(src),
0xfffd, &numSubstitutions, &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
log_err("u_strFromJavaModifiedUTF8WithSub(src=NULL) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, sizeof(dest), &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0x110000, &numSubstitutions, &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
log_err("u_strFromJavaModifiedUTF8WithSub(subchar=U_SENTINEL) failed - %s\n", u_errorName(errorCode));
errorCode=U_ZERO_ERROR;
length=numSubstitutions=-5;
p=u_strFromJavaModifiedUTF8WithSub(dest, sizeof(dest), &length,
- (const char *)src, LENGTHOF(src),
+ (const char *)src, UPRV_LENGTHOF(src),
0xdfff, &numSubstitutions, &errorCode);
if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
log_err("u_strFromJavaModifiedUTF8WithSub(subchar is surrogate) failed - %s\n", u_errorName(errorCode));
dest16[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strFromUTF8(dest16, LENGTHOF(dest16), &length, NULL, 0, &errorCode);
+ u_strFromUTF8(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
log_err("u_strFromUTF8(source=NULL, sourceLength=0) failed\n");
}
dest16[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strFromUTF8WithSub(dest16, LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+ u_strFromUTF8WithSub(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
log_err("u_strFromUTF8WithSub(source=NULL, sourceLength=0) failed\n");
}
dest16[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strFromUTF8Lenient(dest16, LENGTHOF(dest16), &length, NULL, 0, &errorCode);
+ u_strFromUTF8Lenient(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
log_err("u_strFromUTF8Lenient(source=NULL, sourceLength=0) failed\n");
}
dest16[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strFromUTF32(dest16, LENGTHOF(dest16), &length, NULL, 0, &errorCode);
+ u_strFromUTF32(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
log_err("u_strFromUTF32(source=NULL, sourceLength=0) failed\n");
}
dest16[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strFromUTF32WithSub(dest16, LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+ u_strFromUTF32WithSub(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
log_err("u_strFromUTF32WithSub(source=NULL, sourceLength=0) failed\n");
}
dest16[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strFromJavaModifiedUTF8WithSub(dest16, LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+ u_strFromJavaModifiedUTF8WithSub(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
log_err("u_strFromJavaModifiedUTF8WithSub(source=NULL, sourceLength=0) failed\n");
}
dest8[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strToUTF8(dest8, LENGTHOF(dest8), &length, NULL, 0, &errorCode);
+ u_strToUTF8(dest8, UPRV_LENGTHOF(dest8), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest8[0]!=0 || dest8[1]!=3) {
log_err("u_strToUTF8(source=NULL, sourceLength=0) failed\n");
}
dest8[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strToUTF8WithSub(dest8, LENGTHOF(dest8), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+ u_strToUTF8WithSub(dest8, UPRV_LENGTHOF(dest8), &length, NULL, 0, 0xfffd, NULL, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest8[0]!=0 || dest8[1]!=3) {
log_err("u_strToUTF8(source=NULL, sourceLength=0) failed\n");
}
dest32[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strToUTF32(dest32, LENGTHOF(dest32), &length, NULL, 0, &errorCode);
+ u_strToUTF32(dest32, UPRV_LENGTHOF(dest32), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest32[0]!=0 || dest32[1]!=3) {
log_err("u_strToUTF32(source=NULL, sourceLength=0) failed\n");
}
dest32[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strToUTF32WithSub(dest32, LENGTHOF(dest32), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+ u_strToUTF32WithSub(dest32, UPRV_LENGTHOF(dest32), &length, NULL, 0, 0xfffd, NULL, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest32[0]!=0 || dest32[1]!=3) {
log_err("u_strToUTF32WithSub(source=NULL, sourceLength=0) failed\n");
}
dest8[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strToJavaModifiedUTF8(dest8, LENGTHOF(dest8), &length, NULL, 0, &errorCode);
+ u_strToJavaModifiedUTF8(dest8, UPRV_LENGTHOF(dest8), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest8[0]!=0 || dest8[1]!=3) {
log_err("u_strToJavaModifiedUTF8(source=NULL, sourceLength=0) failed\n");
}
dest16[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strFromWCS(dest16, LENGTHOF(dest16), &length, NULL, 0, &errorCode);
+ u_strFromWCS(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
log_err("u_strFromWCS(source=NULL, sourceLength=0) failed\n");
}
destW[0]=3;
length=3;
errorCode=U_ZERO_ERROR;
- u_strToWCS(destW, LENGTHOF(destW), &length, NULL, 0, &errorCode);
+ u_strToWCS(destW, UPRV_LENGTHOF(destW), &length, NULL, 0, &errorCode);
if(errorCode!=U_ZERO_ERROR || length!=0 || destW[0]!=0 || destW[1]!=3) {
log_err("u_strToWCS(source=NULL, sourceLength=0) failed\n");
}