+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1997-2009, International Business Machines Corporation and
+ * Copyright (c) 1997-2016, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include "unicode/utypes.h"
+#include "cmemory.h"
#include "cstring.h"
#include "unicode/unistr.h"
#include "unicode/uniset.h"
static const UChar kErrorUChars[] = { 0x45, 0x52, 0x52, 0x4f, 0x52, 0 };
static const int32_t kErrorLength = 5;
-static const int32_t kERROR_COUNT = -1234567;
//***************************************************************************************
{ "ne", NULL, U_USING_DEFAULT_WARNING, e_Root, { TRUE, FALSE, FALSE }, { TRUE, FALSE, FALSE } }
};
-static const int32_t bundles_count = sizeof(param) / sizeof(param[0]);
+static const int32_t bundles_count = UPRV_LENGTHOF(param);
//***************************************************************************************
{
if (param[5].locale) {
int idx;
- for (idx = 0; idx < (int)(sizeof(param)/sizeof(param[0])); idx++) {
+ for (idx = 0; idx < UPRV_LENGTHOF(param); idx++) {
delete param[idx].locale;
param[idx].locale = NULL;
}
return;
}
- for(i = 0; i < (int32_t)(sizeof(test)/sizeof(test[0])); i++) {
+ for(i = 0; i < UPRV_LENGTHOF(test); i++) {
ResourceBundle res = rb.get(test[i].key, status);
if(U_FAILURE(status))
{
return;
}
- for(i = 0; i < (int32_t)(sizeof(test)/sizeof(test[0])); i++) {
+ for(i = 0; i < UPRV_LENGTHOF(test); i++) {
ResourceBundle rb(testdatapath, test[i].requestedLocale, status);
if(U_FAILURE(status))
{
status = U_ZERO_ERROR;
continue;
}
-
+
locale = res.getLocale(ULOC_REQUESTED_LOCALE, status);
- if(locale != Locale::getDefault()) {
+ if(U_SUCCESS(status) && locale != Locale::getDefault()) {
err("Expected requested locale to be %s. Got %s\n", test[i].requestedLocale, locale.getName());
}
+ status = U_ZERO_ERROR;
locale = res.getLocale(ULOC_VALID_LOCALE, status);
if(strcmp(locale.getName(), test[i].validLocale) != 0) {
err("Expected valid locale to be %s. Got %s\n", test[i].requestedLocale, locale.getName());
}
}
}
-
-//eof
-