X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b331163bffd790ced0e88b73f44f86d49ccc48a5..3d1f044b704633e2e541231cd17ae9ecf9ad5c7a:/icuSources/test/cintltst/capitst.c diff --git a/icuSources/test/cintltst/capitst.c b/icuSources/test/cintltst/capitst.c index 163bb642..616e2e7e 100644 --- a/icuSources/test/cintltst/capitst.c +++ b/icuSources/test/cintltst/capitst.c @@ -1,5 +1,7 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** - * Copyright (c) 1997-2014, International Business Machines + * Copyright (c) 1997-2016, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************/ /***************************************************************************** @@ -115,7 +117,7 @@ void TestGetSetAttr(void) { log_err_status(status, "Unable to open collator. %s\n", u_errorName(status)); return; } - for(i = 0; i 0) { @@ -1904,7 +1906,7 @@ void TestMergeSortKeys(void) { "abcd", "abcde" }; - uint32_t casesSize = sizeof(cases)/sizeof(cases[0]); + uint32_t casesSize = UPRV_LENGTHOF(cases); const char* prefix = "foo"; const char* suffix = "egg"; char outBuff1[256], outBuff2[256]; @@ -2045,7 +2047,11 @@ static void TestShortString(void) {"LDE_RDE_KPHONEBOOK_T0024_ZLATN","KPHONEBOOK_LDE", "de@collation=phonebook", U_USING_FALLBACK_WARNING, 0, 0 }, {"LEN_RUS_NO_AS_S4","AS_LROOT_NO_S4", NULL, U_USING_DEFAULT_WARNING, 0, 0 }, - {"LDE_VPHONEBOOK_EO_SI","EO_KPHONEBOOK_LDE_SI", "de@collation=phonebook", U_ZERO_ERROR, 0, 0 }, + // uloc_canonicalize("de__PHONEBOOK") used to return "de@collation=phonebook" + // and we got U_ZERO_ERROR. + // Since ICU-20187 "drop support for long-obsolete locale ID variants..." + // we actually load the "de__PHONEBOOK" bundle and fall back to "de". + {"LDE_VPHONEBOOK_EO_SI","EO_KPHONEBOOK_LDE_SI", "de@collation=phonebook", U_USING_FALLBACK_WARNING, 0, 0 }, {"LDE_Kphonebook","KPHONEBOOK_LDE", "de@collation=phonebook", U_ZERO_ERROR, 0, 0 }, {"Xqde_DE@collation=phonebookq_S3_EX","KPHONEBOOK_LDE", "de@collation=phonebook", U_USING_FALLBACK_WARNING, 0, 0 }, {"LFR_FO", "FO_LROOT", NULL, U_USING_DEFAULT_WARNING, 0, 0 }, @@ -2061,7 +2067,7 @@ static void TestShortString(void) const char* locale = NULL; - for(i = 0; i < sizeof(testCases)/sizeof(testCases[0]); i++) { + for(i = 0; i < UPRV_LENGTHOF(testCases); i++) { status = U_ZERO_ERROR; if(testCases[i].locale) { locale = testCases[i].locale; @@ -2217,7 +2223,7 @@ TestGetContractionsAndUnsafes(void) UChar buffer[65536]; int32_t setLen = 0; - for(i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { + for(i = 0; i < UPRV_LENGTHOF(tests); i++) { log_verbose("Testing locale: %s\n", tests[i].locale); coll = ucol_open(tests[i].locale, &status); if (coll == NULL || U_FAILURE(status)) { @@ -2332,11 +2338,11 @@ TestOpenBinary(void) } #endif - genericOrderingTest(coll, wUCA, sizeof(wUCA)/sizeof(wUCA[0])); + genericOrderingTest(coll, wUCA, UPRV_LENGTHOF(wUCA)); - genericOrderingTest(cloneWUCA, wUCA, sizeof(wUCA)/sizeof(wUCA[0])); + genericOrderingTest(cloneWUCA, wUCA, UPRV_LENGTHOF(wUCA)); #if OPEN_BINARY_ACCEPTS_NULL_BASE - genericOrderingTest(cloneNOUCA, noUCA, sizeof(noUCA)/sizeof(noUCA[0])); + genericOrderingTest(cloneNOUCA, noUCA, UPRV_LENGTHOF(noUCA)); #endif if(image != imageBuffer) {