mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-3378 Fix cintltst compilation errors.
X-SVN-Rev: 25532
This commit is contained in:
parent
f96da10edc
commit
a5894c4401
3 changed files with 36 additions and 25 deletions
|
@ -2296,14 +2296,15 @@ static void TestGetKeywordValuesForLocale(void) {
|
|||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UEnumeration *keywordValues = NULL;
|
||||
int32_t i, n;
|
||||
int32_t i, n, size, valueLength;
|
||||
const char *locale = NULL, *value = NULL;
|
||||
UBool errorOccurred = FALSE;
|
||||
|
||||
for (i = 0; i < PREFERRED_SIZE; i++) {
|
||||
const char *locale = PREFERRED[i][0];
|
||||
const char *value = NULL;
|
||||
int32_t valueLength = 0;
|
||||
int32_t size = 0;
|
||||
locale = PREFERRED[i][0];
|
||||
value = NULL;
|
||||
valueLength = 0;
|
||||
size = 0;
|
||||
|
||||
keywordValues = ucol_getKeywordValuesForLocale("collation", locale, TRUE, &status);
|
||||
if (keywordValues == NULL || U_FAILURE(status)) {
|
||||
|
|
|
@ -1406,20 +1406,26 @@ static void TestGetKeywordValuesForLocale() {
|
|||
};
|
||||
const int32_t EXPECTED_SIZE[PREFERRED_SIZE] = { 1, 1, 1, 1, 2, 2, 2, 2, 4, 2, 2, 2, 1 };
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t i;
|
||||
int32_t i, size, j;
|
||||
UEnumeration *all, *pref;
|
||||
const char *loc = NULL;
|
||||
UBool matchPref, matchAll;
|
||||
const char *value;
|
||||
int32_t valueLength;
|
||||
UList *ALLList = NULL;
|
||||
|
||||
UEnumeration *ALL = ucal_getKeywordValuesForLocale("calendar", uloc_getDefault(), FALSE, &status);
|
||||
if (U_SUCCESS(status)) {
|
||||
for (i = 0; i < PREFERRED_SIZE; i++) {
|
||||
UEnumeration *pref = NULL;
|
||||
UEnumeration *all = NULL;
|
||||
const char *loc = PREFERRED[i][0];
|
||||
pref = NULL;
|
||||
all = NULL;
|
||||
loc = PREFERRED[i][0];
|
||||
pref = ucal_getKeywordValuesForLocale("calendar", loc, TRUE, &status);
|
||||
UBool matchPref = FALSE;
|
||||
UBool matchAll = FALSE;
|
||||
int32_t size, j;
|
||||
const char *value = NULL;
|
||||
int32_t valueLength = 0;
|
||||
matchPref = FALSE;
|
||||
matchAll = FALSE;
|
||||
|
||||
value = NULL;
|
||||
valueLength = 0;
|
||||
|
||||
if (U_SUCCESS(status) && uenum_count(pref, &status) == EXPECTED_SIZE[i]) {
|
||||
matchPref = TRUE;
|
||||
|
@ -1449,7 +1455,7 @@ static void TestGetKeywordValuesForLocale() {
|
|||
|
||||
if (U_SUCCESS(status) && size == uenum_count(ALL, &status)) {
|
||||
matchAll = TRUE;
|
||||
UList *ALLList = ulist_getListFromEnum(ALL);
|
||||
ALLList = ulist_getListFromEnum(ALL);
|
||||
for (j = 0; j < size; j++) {
|
||||
if ((value = uenum_next(all, &valueLength, &status)) != NULL && U_SUCCESS(status)) {
|
||||
if (!ulist_containsString(ALLList, value, uprv_strlen(value))) {
|
||||
|
|
|
@ -886,7 +886,14 @@ static void TestGetKeywordValuesForLocale(void) {
|
|||
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1
|
||||
};
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t i;
|
||||
int32_t i, j, size;
|
||||
UEnumeration *pref, *all;
|
||||
const char *loc = NULL;
|
||||
UBool matchPref, matchAll;
|
||||
const char *value = NULL;
|
||||
int32_t valueLength = 0;
|
||||
|
||||
UList *ALLList = NULL;
|
||||
|
||||
UEnumeration *ALL = ucurr_getKeywordValuesForLocale("currency", uloc_getDefault(), FALSE, &status);
|
||||
if (ALL == NULL) {
|
||||
|
@ -895,15 +902,12 @@ static void TestGetKeywordValuesForLocale(void) {
|
|||
}
|
||||
|
||||
for (i = 0; i < PREFERRED_SIZE; i++) {
|
||||
UEnumeration *pref = NULL;
|
||||
UEnumeration *all = NULL;
|
||||
const char *loc = PREFERRED[i][0];
|
||||
pref = NULL;
|
||||
all = NULL;
|
||||
loc = PREFERRED[i][0];
|
||||
pref = ucurr_getKeywordValuesForLocale("currency", loc, TRUE, &status);
|
||||
UBool matchPref = FALSE;
|
||||
UBool matchAll = FALSE;
|
||||
int32_t size = 0, j;
|
||||
const char *value = NULL, *allValue = NULL;
|
||||
int32_t valueLength = 0, allValueLength = 0;
|
||||
matchPref = FALSE;
|
||||
matchAll = FALSE;
|
||||
|
||||
size = uenum_count(pref, &status);
|
||||
|
||||
|
@ -935,7 +939,7 @@ static void TestGetKeywordValuesForLocale(void) {
|
|||
|
||||
if (U_SUCCESS(status) && size == uenum_count(ALL, &status)) {
|
||||
matchAll = TRUE;
|
||||
UList *ALLList = ulist_getListFromEnum(ALL);
|
||||
ALLList = ulist_getListFromEnum(ALL);
|
||||
for (j = 0; j < size; j++) {
|
||||
if ((value = uenum_next(all, &valueLength, &status)) != NULL && U_SUCCESS(status)) {
|
||||
if (!ulist_containsString(ALLList, value, uprv_strlen(value))) {
|
||||
|
|
Loading…
Add table
Reference in a new issue