/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2015, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/*******************************************************************************
#include "unicode/ustring.h"
#include "unicode/ucnv.h"
#include "string.h"
+#include "cmemory.h"
#include "cstring.h"
#include "unicode/uchar.h"
#include "ucol_imp.h" /* for U_ICUDATA_COLL */
{ "ne", U_USING_DEFAULT_WARNING, e_Root, { TRUE, FALSE, FALSE }, { TRUE, FALSE, FALSE } }
};
-static int32_t bundles_count = sizeof(param) / sizeof(param[0]);
+static int32_t bundles_count = UPRV_LENGTHOF(param);
}
ures_close(he);
- size = sizeof(norwayNames)/sizeof(norwayNames[0]);
+ size = UPRV_LENGTHOF(norwayNames);
for(i = 0; i < size; i++) {
status = U_ZERO_ERROR;
norway = ures_open(NULL, norwayNames[i], &status);
}
#endif
- u_memset(largeBuffer, 0x0030, sizeof(largeBuffer)/sizeof(largeBuffer[0]));
- largeBuffer[sizeof(largeBuffer)/sizeof(largeBuffer[0])-1] = 0;
+ u_memset(largeBuffer, 0x0030, UPRV_LENGTHOF(largeBuffer));
+ largeBuffer[UPRV_LENGTHOF(largeBuffer)-1] = 0;
/*Test ures_openU */
UResourceBundle* tResB;
UResourceBundle* zoneResource;
const UChar* version = NULL;
- static const UChar versionStr[] = { 0x0032, 0x002E, 0x0031, 0x002E, 0x0036, 0x002E, 0x0036, 0x0039, 0x0000}; // 2.1.6.69
+ static const UChar versionStr[] = { 0x0032, 0x002E, 0x0031, 0x002E, 0x0031, 0x0039, 0x002E, 0x0031, 0x0034, 0x0000}; // 2.1.19.14
if(err != U_ZERO_ERROR){
log_data_err("Expected U_ZERO_ERROR when trying to test no_NO_NY aliased to nn_NO for Version err=%s\n",u_errorName(err));
if(U_FAILURE(status)) {
log_err("FAIL: Couldn't get testGetStringByKeyAliasing resource: %s\n", u_errorName(status));
} else {
- for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
+ for(i = 0; i < UPRV_LENGTHOF(strings); i++) {
result = tres_getString(tb, -1, keys[i], &resultLen, &status);
if(U_FAILURE(status)){
log_err("(1) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status));
log_err("(1) Didn't get correct string while accessing alias table by key (%s)\n", keys[i]);
}
}
- for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
+ for(i = 0; i < UPRV_LENGTHOF(strings); i++) {
result = tres_getString(tb, i, NULL, &resultLen, &status);
if(U_FAILURE(status)){
log_err("(2) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status));
log_err("(2) Didn't get correct string while accesing alias table by index (%s)\n", strings[i]);
}
}
- for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
+ for(i = 0; i < UPRV_LENGTHOF(strings); i++) {
result = ures_getNextString(tb, &resultLen, &key, &status);
if(U_FAILURE(status)){
log_err("(3) Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status));
if(U_FAILURE(status)) {
log_err("FAIL: Couldn't get testGetStringByIndexAliasing resource: %s\n", u_errorName(status));
} else {
- for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
+ for(i = 0; i < UPRV_LENGTHOF(strings); i++) {
result = tres_getString(tb, i, NULL, &resultLen, &status);
if(U_FAILURE(status)){
log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status));
log_err("Didn't get correct string while accesing alias by index in an array (%s)\n", strings[i]);
}
}
- for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
+ for(i = 0; i < UPRV_LENGTHOF(strings); i++) {
result = ures_getNextString(tb, &resultLen, &key, &status);
if(U_FAILURE(status)){
log_err("Fetching the resource with key %s failed. Error: %s\n", keys[i], u_errorName(status));