Update ICU4C/CLDR to versions 54.1/26.
Failing test summary:
| *** FAILING TEST SUMMARY FOR: intltest
TestCanonicalID
TimeZoneTest
TestTimeRoundTrip
TimeZoneFormatTest
format
| *** END FAILING TEST SUMMARY FOR: intltest
-----------
ALL TESTS SUMMARY:
ok: testdata iotest cintltst letest
===== ERRS: intltest
Change-Id: I91c82ef1042905bb6454a30c6973b4573da56f77
diff --git a/icu4c/source/test/cintltst/udatatst.c b/icu4c/source/test/cintltst/udatatst.c
index bdcf834..b0740da 100644
--- a/icu4c/source/test/cintltst/udatatst.c
+++ b/icu4c/source/test/cintltst/udatatst.c
@@ -16,6 +16,7 @@
#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/udata.h"
+#include "unicode/ucal.h"
#include "unicode/uchar.h"
#include "unicode/ucnv.h"
#include "unicode/ures.h"
@@ -55,8 +56,6 @@
/* other definitions and prototypes */
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
#if !UCONFIG_NO_FILE_IO && !UCONFIG_NO_LEGACY_CONVERSION
static void TestUDataOpen(void);
static void TestUDataOpenChoiceDemo1(void);
@@ -72,7 +71,9 @@
static void PointerTableOfContents(void);
static void SetBadCommonData(void);
static void TestUDataFileAccess(void);
-
+#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_FILE_IO && !UCONFIG_NO_LEGACY_CONVERSION
+static void TestTZDataDir(void);
+#endif
void addUDataTest(TestNode** root);
@@ -94,6 +95,9 @@
addTest(root, &PointerTableOfContents, "udatatst/PointerTableOfContents" );
addTest(root, &SetBadCommonData, "udatatst/SetBadCommonData" );
addTest(root, &TestUDataFileAccess, "udatatst/TestUDataFileAccess" );
+#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_FILE_IO && !UCONFIG_NO_LEGACY_CONVERSION
+ addTest(root, &TestTZDataDir, "udatatst/TestTZDataDir" );
+#endif
}
#if 0
@@ -1367,15 +1371,18 @@
* to testdata) for code coverage in tests.
* See Jitterbug 4497.
*
- * ICU4C 4.4 adds normalization data files again, e.g., nfc.nrm.
+ * ICU4C 4.4 adds normalization data files again, e.g., nfkc.nrm.
*/
{"uprops", "icu", uprops_swap},
{"ucase", "icu", ucase_swap},
{"ubidi", "icu", ubidi_swap},
#endif
#if !UCONFIG_NO_NORMALIZATION && !UCONFIG_ONLY_COLLATION
- {"nfc", "nrm", unorm2_swap},
- {"confusables", "cfu", uspoof_swap},
+ {"nfkc", "nrm", unorm2_swap},
+#if !UCONFIG_NO_REGULAR_EXPRESSIONS
+ {"confusables", "cfu", uspoof_swap}, /* spoof data missing without regex */
+#endif
+
#endif
{"unames", "icu", uchar_swapNames}
/* the last item should not be #if'ed so that it can reliably omit the last comma */
@@ -1688,7 +1695,7 @@
errorCode=U_ZERO_ERROR;
#endif
- for(i=0; i<LENGTHOF(swapCases); ++i) {
+ for(i=0; i<UPRV_LENGTHOF(swapCases); ++i) {
/* build the name for logging */
errorCode=U_ZERO_ERROR;
if(swapCases[i].name[0]=='*') {
@@ -1813,3 +1820,49 @@
}
}
+// Check the override loading of time zone .res files from a specified path
+//
+// Hand testing notes:
+// 1. Run this test with the environment variable set. The following should induce faiures:
+// ICU_TIMEZONE_FILES_DIR=../testdata/out/build LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH ./cintltst /udatatst/TestTZDataDir
+// 2. Build ICU with with U_TIMEZONE_FILES_DIR defined. This should also induce failures.
+// CPPFLAGS=-DU_TIMEZONE_FILES_DIR\=`pwd`/test/testdata/out/testdata ./runConfigureICU Linux
+// make check
+
+static void TestTZDataDir(void) {
+#if !UCONFIG_NO_FORMATTING
+ UErrorCode status = U_ZERO_ERROR;
+ const char *tzDataVersion;
+ const char *testDataPath;
+
+ // Verify that default ICU time zone data version is something newer than 2014a.
+ tzDataVersion = ucal_getTZDataVersion(&status);
+ // printf("tz data version is %s\n", tzDataVersion);
+ if (U_FAILURE(status)) {
+ log_data_err("Failed call to ucal_getTZDataVersion - %s\n", u_errorName(status));
+ return;
+ } else if (strcmp("2014a", tzDataVersion) == 0) {
+ log_err("File %s:%d - expected something newer than time zone data 2014a.\n", __FILE__, __LINE__, tzDataVersion);
+ }
+
+ testDataPath = loadTestData(&status);
+ // The path produced by loadTestData() will look something like
+ // whatever/.../testdata/out/testdata
+ // The test data puts an old (2014a) version of the time zone data there.
+
+ // Switch ICU to the testdata version of zoneinfo64.res, which is verison 2014a.
+ ctest_resetICU();
+ u_setTimeZoneFilesDirectory(testDataPath, &status);
+ tzDataVersion = ucal_getTZDataVersion(&status);
+ if (strcmp("2014a", tzDataVersion) != 0) {
+ log_err("File %s:%d - expected \"2014a\"; actual \"%s\"\n", __FILE__, __LINE__, tzDataVersion);
+ }
+
+ ctest_resetICU(); // Return ICU to using its standard tz data.
+ tzDataVersion = ucal_getTZDataVersion(&status);
+ // printf("tz data version is %s\n", tzDataVersion);
+ if (strcmp("2014a", tzDataVersion) == 0) {
+ log_err("File %s:%d - expected something newer than time zone data 2014a.\n", __FILE__, __LINE__, tzDataVersion);
+ }
+#endif
+}