]> granicus.if.org Git - icu/commitdiff
ICU-12752 IBM i now passes
authorSteven R. Loomis <srl@icu-project.org>
Thu, 22 Sep 2016 01:25:52 +0000 (01:25 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Thu, 22 Sep 2016 01:25:52 +0000 (01:25 +0000)
X-SVN-Rev: 39326

icu4c/source/common/udataswp.h
icu4c/source/common/uloc_keytype.cpp
icu4c/source/test/cintltst/cdateintervalformattest.c
icu4c/source/test/cintltst/cloctst.c

index cd5d049b32001f7612a1d18d8e49264c50b77f34..07e06c221a7075963bf00b3edd75dbaad1bc01eb 100644 (file)
@@ -320,6 +320,20 @@ uprv_compareInvEbcdic(const UDataSwapper *ds,
                       const char *outString, int32_t outLength,
                       const UChar *localString, int32_t localLength);
 
+/**
+ * \def uprv_compareInvWithUChar
+ * Compare an invariant-character strings with a UChar string
+ * @internal
+ */
+#if U_CHARSET_FAMILY==U_ASCII_FAMILY
+#   define uprv_compareInvWithUChar uprv_compareInvAscii
+#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
+#   define uprv_compareInvWithUChar uprv_compareInvEbcdic
+#else
+#   error Unknown charset family!
+#endif
+
+
 /* material... -------------------------------------------------------------- */
 
 #if 0
index 26261f3b625291efe2385b1a5cae23deafc5baef..fcb066c0dd72e676eca25463308c1180c7928f7e 100644 (file)
@@ -15,6 +15,7 @@
 #include "umutex.h"
 #include "uresimp.h"
 #include "uvector.h"
+#include "udataswp.h" /* for InvChar functions */
 
 static UHashtable* gLocExtKeyMap = NULL;
 static icu::UInitOnce gLocExtKeyMapInitOnce = U_INITONCE_INITIALIZER;
@@ -314,7 +315,7 @@ initFromResourceBundle(UErrorCode& sts) {
                             break;
                         }
                         // check if this is an alias of canoncal legacy type
-                        if (uprv_compareInvAscii(NULL, legacyTypeId, -1, to, toLen) == 0) {
+                        if (uprv_compareInvWithUChar(NULL, legacyTypeId, -1, to, toLen) == 0) {
                             const char* from = ures_getKey(typeAliasDataEntry.getAlias());
                             if (isTZ) {
                                 // replace colon with slash if necessary
@@ -364,7 +365,7 @@ initFromResourceBundle(UErrorCode& sts) {
                             break;
                         }
                         // check if this is an alias of bcp type
-                        if (uprv_compareInvAscii(NULL, bcpTypeId, -1, to, toLen) == 0) {
+                        if (uprv_compareInvWithUChar(NULL, bcpTypeId, -1, to, toLen) == 0) {
                             const char* from = ures_getKey(bcpTypeAliasDataEntry.getAlias());
                             uhash_put(typeDataMap, (void*)from, t, &sts);
                         }
index cd787022cfa3572ae25e1954c802c7440a108046..72110fa596e4415ae43cff7dd8e5e7b7cc8378d6 100644 (file)
@@ -282,8 +282,7 @@ static void TestFPos_SkelWithSeconds()
            UChar   ubuf[kSizeUBuf];
            int32_t ulen, uelen;
            UErrorCode status = U_ZERO_ERROR;
-           
-           u_strFromUTF8(ubuf, kSizeUBuf, &ulen, locSkelItemPtr->skeleton, -1, &status);
+            ulen = u_unescape(locSkelItemPtr->skeleton, ubuf, kSizeUBuf);
            udifmt = udtitvfmt_open(locSkelItemPtr->locale, ubuf, ulen, zoneGMT, -1, &status);
            if ( U_FAILURE(status) ) {
            log_data_err("FAIL: udtitvfmt_open for locale %s, skeleton %s: %s\n",
index 9c2cafa87980b9fa10bff1559dc2f385b6e6130d..2bbab855d45ac93135372050ce9df8e4a5c65795 100644 (file)
@@ -6159,6 +6159,8 @@ static void TestToLegacyType(void)
             }
         } else if (uprv_strcmp(legacyType, expected) != 0) {
             log_data_err("toLegacyType: keyword=%s, value=%s => %s, expected=%s\n", keyword, value, legacyType, expected);
+        } else {
+            log_verbose("toLegacyType: keyword=%s, value=%s => %s\n", keyword, value, legacyType);
         }
     }
 }