OLD | NEW |
1 /******************************************************************** | 1 /******************************************************************** |
2 * COPYRIGHT: | 2 * COPYRIGHT: |
3 * Copyright (c) 1997-2014, International Business Machines Corporation and | 3 * Copyright (c) 1997-2015, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 ********************************************************************/ | 5 ********************************************************************/ |
6 | 6 |
7 #include "cintltst.h" | 7 #include "cintltst.h" |
8 #include "unicode/ures.h" | 8 #include "unicode/ures.h" |
9 #include "unicode/ucurr.h" | 9 #include "unicode/ucurr.h" |
10 #include "unicode/ustring.h" | 10 #include "unicode/ustring.h" |
11 #include "unicode/uset.h" | 11 #include "unicode/uset.h" |
12 #include "unicode/udat.h" | 12 #include "unicode/udat.h" |
13 #include "unicode/uscript.h" | 13 #include "unicode/uscript.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if(strcmp(localeName, lcidStringC) != 0) { | 473 if(strcmp(localeName, lcidStringC) != 0) { |
474 char langName[1024]; | 474 char langName[1024]; |
475 char langLCID[1024]; | 475 char langLCID[1024]; |
476 uloc_getLanguage(localeName, langName, sizeof(langName), &status); | 476 uloc_getLanguage(localeName, langName, sizeof(langName), &status); |
477 uloc_getLanguage(lcidStringC, langLCID, sizeof(langLCID), &status); | 477 uloc_getLanguage(lcidStringC, langLCID, sizeof(langLCID), &status); |
478 | 478 |
479 if (strcmp(langName, langLCID) == 0) { | 479 if (strcmp(langName, langLCID) == 0) { |
480 log_verbose("WARNING: %-5s resolves to %s (0x%.4x)\n", | 480 log_verbose("WARNING: %-5s resolves to %s (0x%.4x)\n", |
481 localeName, lcidStringC, expectedLCID); | 481 localeName, lcidStringC, expectedLCID); |
482 } | 482 } |
483 else if (strncmp(localeName, "hsb", 3) != 0 || !log_knownIssue("11216",
"Duplicate LCID mapping for language hsb")) { | 483 else { |
484 log_err("ERROR: %-5s has 0x%.4x and the number resolves wrongfully
to %s\n", | 484 log_err("ERROR: %-5s has 0x%.4x and the number resolves wrongfully
to %s\n", |
485 localeName, expectedLCID, lcidStringC); | 485 localeName, expectedLCID, lcidStringC); |
486 } | 486 } |
487 } | 487 } |
488 } | 488 } |
489 | 489 |
490 #if !UCONFIG_NO_FILE_IO && !UCONFIG_NO_LEGACY_CONVERSION | 490 #if !UCONFIG_NO_FILE_IO && !UCONFIG_NO_LEGACY_CONVERSION |
491 static void | 491 static void |
492 TestLocaleStructure(void) { | 492 TestLocaleStructure(void) { |
493 // This test checks the locale structure against a key file located | 493 // This test checks the locale structure against a key file located |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 if (U_FAILURE(errorCode)) { | 981 if (U_FAILURE(errorCode)) { |
982 log_err("error ures_getByKey returned %s\n", u_errorName(err
orCode)); | 982 log_err("error ures_getByKey returned %s\n", u_errorName(err
orCode)); |
983 } | 983 } |
984 if (getTestOption(QUICK_OPTION)) { | 984 if (getTestOption(QUICK_OPTION)) { |
985 end = 1; | 985 end = 1; |
986 } | 986 } |
987 else { | 987 else { |
988 end = ures_getSize(resArray); | 988 end = ures_getSize(resArray); |
989 } | 989 } |
990 | 990 |
| 991 if ((uprv_strncmp(currLoc,"lrc",3) == 0 || uprv_strncmp(currLoc,
"mzn",3) == 0) && |
| 992 log_knownIssue("cldrbug:8899", "lrc and mzn locales don'
t have translated day names")) { |
| 993 end = 0; |
| 994 } |
991 | 995 |
992 for (idx = 0; idx < end; idx++) { | 996 for (idx = 0; idx < end; idx++) { |
993 const UChar *fromBundleStr = ures_getStringByIndex(resArray,
idx, &langSize, &errorCode); | 997 const UChar *fromBundleStr = ures_getStringByIndex(resArray,
idx, &langSize, &errorCode); |
994 if (U_FAILURE(errorCode)) { | 998 if (U_FAILURE(errorCode)) { |
995 log_err("error ures_getStringByIndex(%d) returned %s\n",
idx, u_errorName(errorCode)); | 999 log_err("error ures_getStringByIndex(%d) returned %s\n",
idx, u_errorName(errorCode)); |
996 continue; | 1000 continue; |
997 } | 1001 } |
998 strIdx = findStringSetMismatch(currLoc, fromBundleStr, langS
ize, mergedExemplarSet, TRUE, &badChar); | 1002 strIdx = findStringSetMismatch(currLoc, fromBundleStr, langS
ize, mergedExemplarSet, TRUE, &badChar); |
999 if (strIdx >= 0) { | 1003 if ( strIdx >= 0 ) { |
1000 log_err("getDayNames(%s, %d) at index %d returned charac
ters not in the exemplar characters: %04X.\n", | 1004 log_err("getDayNames(%s, %d) at index %d returned charac
ters not in the exemplar characters: %04X.\n", |
1001 currLoc, idx, strIdx, badChar); | 1005 currLoc, idx, strIdx, badChar); |
1002 } | 1006 } |
1003 } | 1007 } |
1004 ures_close(resArray); | 1008 ures_close(resArray); |
1005 ures_close(format); | 1009 ures_close(format); |
1006 ures_close(names); | 1010 ures_close(names); |
1007 | 1011 |
1008 names = ures_getByKeyWithFallback(greg, "monthNames", NULL, &err
orCode); | 1012 names = ures_getByKeyWithFallback(greg, "monthNames", NULL, &err
orCode); |
1009 format = ures_getByKeyWithFallback(names,"format", NULL, &errorC
ode); | 1013 format = ures_getByKeyWithFallback(names,"format", NULL, &errorC
ode); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 | 1082 |
1079 errorCode = U_ZERO_ERROR; | 1083 errorCode = U_ZERO_ERROR; |
1080 measurementSystem = ulocdata_getMeasurementSystem(currLoc, &error
Code); | 1084 measurementSystem = ulocdata_getMeasurementSystem(currLoc, &error
Code); |
1081 if (U_FAILURE(errorCode)) { | 1085 if (U_FAILURE(errorCode)) { |
1082 log_err("ulocdata_getMeasurementSystem failed for locale %s w
ith error: %s \n", currLoc, u_errorName(errorCode)); | 1086 log_err("ulocdata_getMeasurementSystem failed for locale %s w
ith error: %s \n", currLoc, u_errorName(errorCode)); |
1083 } else { | 1087 } else { |
1084 if ( strstr(fullLoc, "_US")!=NULL || strstr(fullLoc, "_MM")!=
NULL || strstr(fullLoc, "_LR")!=NULL ) { | 1088 if ( strstr(fullLoc, "_US")!=NULL || strstr(fullLoc, "_MM")!=
NULL || strstr(fullLoc, "_LR")!=NULL ) { |
1085 if(measurementSystem != UMS_US){ | 1089 if(measurementSystem != UMS_US){ |
1086 log_err("ulocdata_getMeasurementSystem did not retur
n expected data for locale %s \n", currLoc); | 1090 log_err("ulocdata_getMeasurementSystem did not retur
n expected data for locale %s \n", currLoc); |
1087 } | 1091 } |
| 1092 } else if ( strstr(fullLoc, "_GB")!=NULL ) { |
| 1093 if(measurementSystem != UMS_UK){ |
| 1094 log_err("ulocdata_getMeasurementSystem did not retur
n expected data for locale %s \n", currLoc); |
| 1095 } |
1088 } else if (measurementSystem != UMS_SI) { | 1096 } else if (measurementSystem != UMS_SI) { |
1089 log_err("ulocdata_getMeasurementSystem did not return exp
ected data for locale %s \n", currLoc); | 1097 log_err("ulocdata_getMeasurementSystem did not return exp
ected data for locale %s \n", currLoc); |
1090 } | 1098 } |
1091 } | 1099 } |
1092 | 1100 |
1093 errorCode = U_ZERO_ERROR; | 1101 errorCode = U_ZERO_ERROR; |
1094 ulocdata_getPaperSize(currLoc, &height, &width, &errorCode); | 1102 ulocdata_getPaperSize(currLoc, &height, &width, &errorCode); |
1095 if (U_FAILURE(errorCode)) { | 1103 if (U_FAILURE(errorCode)) { |
1096 log_err("ulocdata_getPaperSize failed for locale %s with erro
r: %s \n", currLoc, u_errorName(errorCode)); | 1104 log_err("ulocdata_getPaperSize failed for locale %s with erro
r: %s \n", currLoc, u_errorName(errorCode)); |
1097 } else { | 1105 } else { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 #endif | 1522 #endif |
1515 TESTCASE(TestConsistentCountryInfo); | 1523 TESTCASE(TestConsistentCountryInfo); |
1516 TESTCASE(VerifyTranslation); | 1524 TESTCASE(VerifyTranslation); |
1517 TESTCASE(TestExemplarSet); | 1525 TESTCASE(TestExemplarSet); |
1518 TESTCASE(TestLocaleDisplayPattern); | 1526 TESTCASE(TestLocaleDisplayPattern); |
1519 TESTCASE(TestCoverage); | 1527 TESTCASE(TestCoverage); |
1520 TESTCASE(TestIndexChars); | 1528 TESTCASE(TestIndexChars); |
1521 TESTCASE(TestAvailableIsoCodes); | 1529 TESTCASE(TestAvailableIsoCodes); |
1522 } | 1530 } |
1523 | 1531 |
OLD | NEW |