From 3f2fb26333cd9f8b8be2a5712137d30bb4dd5c0e Mon Sep 17 00:00:00 2001 From: Helena Chapman Date: Mon, 14 Aug 2000 23:35:57 +0000 Subject: [PATCH] ICU-401 Make 1.6 tree compiled and linked on S/400. X-SVN-Rev: 2233 --- icu4c/source/common/unicode/utypes.h | 2 - icu4c/source/test/cintltst/capitst.c | 2 +- icu4c/source/test/cintltst/cbiapts.c | 4 +- icu4c/source/test/cintltst/cbiapts.h | 2 +- icu4c/source/test/cintltst/cbiditst.c | 8 +- icu4c/source/test/cintltst/ccaltst.c | 10 +-- icu4c/source/test/cintltst/ccaltst.h | 2 +- icu4c/source/test/cintltst/ccapitst.c | 27 ------ icu4c/source/test/cintltst/ccurrtst.c | 6 +- icu4c/source/test/cintltst/cdantst.c | 2 +- icu4c/source/test/cintltst/cdantst.h | 2 +- icu4c/source/test/cintltst/cdetst.c | 2 +- icu4c/source/test/cintltst/cdetst.h | 2 +- icu4c/source/test/cintltst/cestst.c | 2 +- icu4c/source/test/cintltst/cestst.h | 2 +- icu4c/source/test/cintltst/cfintst.c | 2 +- icu4c/source/test/cintltst/cfintst.h | 2 +- icu4c/source/test/cintltst/cfrtst.c | 2 +- icu4c/source/test/cintltst/cfrtst.h | 2 +- icu4c/source/test/cintltst/cg7coll.c | 2 +- icu4c/source/test/cintltst/cg7coll.h | 2 +- icu4c/source/test/cintltst/chashtst.c | 2 +- icu4c/source/test/cintltst/cintltst.c | 2 +- icu4c/source/test/cintltst/citertst.c | 2 +- icu4c/source/test/cintltst/citertst.h | 2 +- icu4c/source/test/cintltst/cjaptst.c | 2 +- icu4c/source/test/cintltst/cjaptst.h | 2 +- icu4c/source/test/cintltst/cloctst.c | 120 ++++++++++++------------- icu4c/source/test/cintltst/cloctst.h | 2 +- icu4c/source/test/cintltst/cnormtst.c | 2 +- icu4c/source/test/cintltst/cnumtst.c | 6 +- icu4c/source/test/cintltst/cturtst.c | 2 +- icu4c/source/test/cintltst/cturtst.h | 2 +- icu4c/source/test/cintltst/cucdtst.c | 4 +- icu4c/source/test/cintltst/encoll.c | 2 +- icu4c/source/test/cintltst/encoll.h | 2 +- icu4c/source/test/cintltst/ncnvfbts.c | 12 +-- icu4c/source/test/cintltst/ncnvtst.c | 10 +-- icu4c/source/test/cintltst/nucnvtst.c | 22 ++--- icu4c/source/test/cintltst/udatatst.c | 20 ++--- icu4c/source/test/cintltst/utf16tst.c | 8 +- icu4c/source/test/cintltst/utf8tst.c | 5 +- icu4c/source/test/intltest/allcoll.cpp | 4 + icu4c/source/test/intltest/tztest.cpp | 16 ---- 44 files changed, 147 insertions(+), 191 deletions(-) diff --git a/icu4c/source/common/unicode/utypes.h b/icu4c/source/common/unicode/utypes.h index 69c15df6a9a..0782655c0ce 100644 --- a/icu4c/source/common/unicode/utypes.h +++ b/icu4c/source/common/unicode/utypes.h @@ -35,9 +35,7 @@ #include "unicode/umachine.h" #include "unicode/utf.h" -#ifndef __OS400__ #include -#endif #include /*===========================================================================*/ diff --git a/icu4c/source/test/cintltst/capitst.c b/icu4c/source/test/cintltst/capitst.c index dc0a2e1c133..160cd4eaefb 100644 --- a/icu4c/source/test/cintltst/capitst.c +++ b/icu4c/source/test/cintltst/capitst.c @@ -63,7 +63,7 @@ void TestGetDefaultRules(){ const UChar * defaultRulesArray=ucol_getDefaultRulesArray(&size); log_verbose("Test the function ucol_getDefaultRulesArray()\n"); - coll = ucol_openRules(defaultRulesArray, size, UCOL_DECOMP_CAN, 0, &status); + coll = ucol_openRules(defaultRulesArray, size, UCOL_DECOMP_CAN, UCOL_PRIMARY, &status); ucol_setNormalization(coll, UCOL_DEFAULT_NORMALIZATION); if(U_SUCCESS(status) && coll !=NULL) { binColData = (uint8_t*)ucol_cloneRuleData(coll, &len1, &status); diff --git a/icu4c/source/test/cintltst/cbiapts.c b/icu4c/source/test/cintltst/cbiapts.c index ec28b9dc353..70243a99f74 100644 --- a/icu4c/source/test/cintltst/cbiapts.c +++ b/icu4c/source/test/cintltst/cbiapts.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Creation -********************************************************************************* +*********************************************************************************/ /*C API TEST FOR BREAKITERATOR */ /** * This is an API test. It doesn't test very many cases, and doesn't @@ -80,7 +80,7 @@ void TestBreakIteratorCAPI() log_verbose("PASS: Successfully opened character breakiterator\n"); } /*trying to open an illegal iterator*/ - bogus = ubrk_open(4, "en_US", text, u_strlen(text), &status); + bogus = ubrk_open((UBreakIteratorType)4, "en_US", text, u_strlen(text), &status); if(U_SUCCESS(status)){ log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_MEMORY_ALLOCATION_ERROR"); } diff --git a/icu4c/source/test/cintltst/cbiapts.h b/icu4c/source/test/cintltst/cbiapts.h index d3985d12343..c9ff7551518 100644 --- a/icu4c/source/test/cintltst/cbiapts.h +++ b/icu4c/source/test/cintltst/cbiapts.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Creation -********************************************************************************* +*********************************************************************************/ /* C API TEST FOR BREAKITERATOR */ #ifndef _CBRKITRAPITST diff --git a/icu4c/source/test/cintltst/cbiditst.c b/icu4c/source/test/cintltst/cbiditst.c index e07d3636fcb..8deaa3c0612 100644 --- a/icu4c/source/test/cintltst/cbiditst.c +++ b/icu4c/source/test/cintltst/cbiditst.c @@ -46,7 +46,9 @@ testManyInverseBiDi(UBiDi *pBiDi, UBiDiLevel direction); static void testInverseBiDi(UBiDi *pBiDi, const UChar *src, int32_t srcLength, UBiDiLevel direction, UErrorCode *pErrorCode); -static char *levelString; +/* helpers ------------------------------------------------------------------ */ + +static char *levelString="..............................................................."; static UChar * getStringFromDirProps(const uint8_t *dirProps, UTextOffset length); @@ -740,10 +742,6 @@ doArabicShapingTest() { } } -/* helpers ------------------------------------------------------------------ */ - -static char *levelString="..............................................................."; - /* return a string with characters according to the desired directional properties */ static UChar * getStringFromDirProps(const uint8_t *dirProps, UTextOffset length) { diff --git a/icu4c/source/test/cintltst/ccaltst.c b/icu4c/source/test/cintltst/ccaltst.c index 0da5a30b31a..a5d4cde2e01 100644 --- a/icu4c/source/test/cintltst/ccaltst.c +++ b/icu4c/source/test/cintltst/ccaltst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Creation -********************************************************************************* +*********************************************************************************/ /* C API AND FUNCTIONALITY TEST FOR CALENDAR (ucol.h)*/ @@ -215,7 +215,7 @@ void TestCalendar() log_err("FAIL: set/getFirstDayOfWeek failed\n"); } /*get bogus Attribute*/ - count=ucal_getAttribute(calit, 99); /* BOGUS_ATTRIBUTE */ + count=ucal_getAttribute(calit, (UCalendarAttribute)99); /* BOGUS_ATTRIBUTE */ if(count != -1){ log_err("FAIL: get/bogus attribute should return -1\n"); } @@ -623,7 +623,7 @@ void TestAddRollExtensive() if (U_FAILURE(status)) { log_err("ucal_add failed: %s\n", myErrorName(status) ); return; } ++m; checkDate(cal, y, m, d); - ucal_add(cal, -1, 10, &status); + ucal_add(cal, (UCalendarDateFields)-1, 10, &status); if(status==U_ILLEGAL_ARGUMENT_ERROR) log_verbose("Pass: Illegal argument error as expected\n"); else{ @@ -657,7 +657,7 @@ void TestAddRollExtensive() if (U_FAILURE(status)) { log_err("ucal_roll failed: %s\n", myErrorName(status) ); return; } d = 2; checkDate(cal, y, m, d); - ucal_roll(cal, -1, 10, &status); + ucal_roll(cal, (UCalendarDateFields)-1, 10, &status); if(status==U_ILLEGAL_ARGUMENT_ERROR) log_verbose("Pass: illegal arguement error as expected\n"); else{ @@ -814,7 +814,7 @@ void TestGetLimits() /*get BOGUS_LIMIT type*/ - val=ucal_getLimit(cal, UCAL_SECOND, 99, &status); + val=ucal_getLimit(cal, UCAL_SECOND, (UCalendarLimitType)99, &status); if(val != -1){ log_err("FAIL: ucal_getLimit() with BOGUS type should return -1\n"); } diff --git a/icu4c/source/test/cintltst/ccaltst.h b/icu4c/source/test/cintltst/ccaltst.h index 9a3d6e45cad..971f82b3111 100644 --- a/icu4c/source/test/cintltst/ccaltst.h +++ b/icu4c/source/test/cintltst/ccaltst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Creation -********************************************************************************* +*********************************************************************************/ /* C API TEST FOR CALENDAR */ #ifndef _CCALTST #define _CCALTST diff --git a/icu4c/source/test/cintltst/ccapitst.c b/icu4c/source/test/cintltst/ccapitst.c index b3bd2a6b246..cc878074bdb 100644 --- a/icu4c/source/test/cintltst/ccapitst.c +++ b/icu4c/source/test/cintltst/ccapitst.c @@ -172,33 +172,6 @@ void TestConvert() "ko_KR" }; - /* UChar CodePagesFlakySequence[NUM_CODEPAGE][20] = - { - {(UChar)0xAC10, - (UChar)0xAC11, - (UChar)0xAC12, - (UChar)0xAC13, - (UChar)0xAC14, - (UChar)0xAC15, - (UChar)0xAC16, - (UChar)0xAC17, - (UChar)0xd7a4, /*Offensive Codepoint*/ -/* (UChar)0xAC14, - (UChar)0xAC15} - }; - - char CodePagesFlakyCharSequence[NUM_CODEPAGE][20] = - { - { (char)0xB0, (char)0xA8, - (char)0xB0, (char)0xA9, - (char)0xB0, (char)0xAA, - (char)0xB0, (char)0xAB, - (char)0xb0, (char)0xff,/*Offensive Codepoint*/ -/* (char)0xB0, (char)0xAC, - (char)0xB0, (char)0xAD - } - };*/ - UConverterFromUCallback oldFromUAction = NULL; UConverterToUCallback oldToUAction = NULL; void* oldFromUContext = NULL; diff --git a/icu4c/source/test/cintltst/ccurrtst.c b/icu4c/source/test/cintltst/ccurrtst.c index 93faa88c79b..25e04dad498 100644 --- a/icu4c/source/test/cintltst/ccurrtst.c +++ b/icu4c/source/test/cintltst/ccurrtst.c @@ -107,9 +107,9 @@ void currTest() ucol_getSortKey(c, target, u_strlen(target), sortKey2, sortklen+1); res = memcmp(sortKey1, sortKey2, sortklen); - if (res < 0) keyResult = -1; - else if (res > 0) keyResult = 1; - else keyResult = 0; + if (res < 0) keyResult = (UCollationResult)-1; + else if (res > 0) keyResult = (UCollationResult)1; + else keyResult = (UCollationResult)0; reportCResult(source, target, sortKey1, sortKey2, compareResult, keyResult, expectedResult); diff --git a/icu4c/source/test/cintltst/cdantst.c b/icu4c/source/test/cintltst/cdantst.c index 4c9e4f08a55..bc50be0352e 100644 --- a/icu4c/source/test/cintltst/cdantst.c +++ b/icu4c/source/test/cintltst/cdantst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationDanishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cdantst.h b/icu4c/source/test/cintltst/cdantst.h index 6f85634c030..430df822602 100644 --- a/icu4c/source/test/cintltst/cdantst.h +++ b/icu4c/source/test/cintltst/cdantst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationDanishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cdetst.c b/icu4c/source/test/cintltst/cdetst.c index f300b7d3dad..cc0248699ac 100644 --- a/icu4c/source/test/cintltst/cdetst.c +++ b/icu4c/source/test/cintltst/cdetst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationGermanTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cdetst.h b/icu4c/source/test/cintltst/cdetst.h index c75f5d361fb..c790f7cfc89 100644 --- a/icu4c/source/test/cintltst/cdetst.h +++ b/icu4c/source/test/cintltst/cdetst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationGERMANTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cestst.c b/icu4c/source/test/cintltst/cestst.c index d082da8fd39..31d5b1f3dbb 100644 --- a/icu4c/source/test/cintltst/cestst.c +++ b/icu4c/source/test/cintltst/cestst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationSpanishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cestst.h b/icu4c/source/test/cintltst/cestst.h index 860526e9253..06286c08d39 100644 --- a/icu4c/source/test/cintltst/cestst.h +++ b/icu4c/source/test/cintltst/cestst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationSpanishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cfintst.c b/icu4c/source/test/cintltst/cfintst.c index 69226b7488e..f2f87b07d0a 100644 --- a/icu4c/source/test/cintltst/cfintst.c +++ b/icu4c/source/test/cintltst/cfintst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationFinnishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cfintst.h b/icu4c/source/test/cintltst/cfintst.h index f724e391b9c..11137865f21 100644 --- a/icu4c/source/test/cintltst/cfintst.h +++ b/icu4c/source/test/cintltst/cfintst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationFinnishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cfrtst.c b/icu4c/source/test/cintltst/cfrtst.c index c83dbb22166..93313bbb2b9 100644 --- a/icu4c/source/test/cintltst/cfrtst.c +++ b/icu4c/source/test/cintltst/cfrtst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationFrenchTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cfrtst.h b/icu4c/source/test/cintltst/cfrtst.h index a6c1a531e81..67e783c874f 100644 --- a/icu4c/source/test/cintltst/cfrtst.h +++ b/icu4c/source/test/cintltst/cfrtst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationFrenchTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cg7coll.c b/icu4c/source/test/cintltst/cg7coll.c index 0f4ef4ffc74..79ae22f83ef 100644 --- a/icu4c/source/test/cintltst/cg7coll.c +++ b/icu4c/source/test/cintltst/cg7coll.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * G7CollationTest is a third level test class. This test performs the examples * mentioned on the Taligent international demos web site. diff --git a/icu4c/source/test/cintltst/cg7coll.h b/icu4c/source/test/cintltst/cg7coll.h index c3e892afe41..fdf4fc23b88 100644 --- a/icu4c/source/test/cintltst/cg7coll.h +++ b/icu4c/source/test/cintltst/cg7coll.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * G7CollationTest is a third level test class. This test performs the examples * mentioned on the Taligent international demos web site. diff --git a/icu4c/source/test/cintltst/chashtst.c b/icu4c/source/test/cintltst/chashtst.c index f456466573b..920e56a721f 100644 --- a/icu4c/source/test/cintltst/chashtst.c +++ b/icu4c/source/test/cintltst/chashtst.c @@ -229,7 +229,7 @@ int32_t hashChars(const void* key) { UBool isEqualChars(const void* key1, const void* key2) { return (UBool)((key1 != NULL) && (key2 != NULL) && - (uprv_strcmp(key1, key2) == 0)); + (uprv_strcmp((const char*)key1, (const char*)key2) == 0)); } /********************************************************************** diff --git a/icu4c/source/test/cintltst/cintltst.c b/icu4c/source/test/cintltst/cintltst.c index e4c2d0acca7..0e118a0ab6b 100644 --- a/icu4c/source/test/cintltst/cintltst.c +++ b/icu4c/source/test/cintltst/cintltst.c @@ -76,7 +76,7 @@ int main ( int argc, const char **argv ) root = NULL; addAllTests(&root); - nerrors = processArgs(root, argc, argv); + nerrors = processArgs(root, argc, (const char**)argv); cleanUpTestTree(root); cleanUpDataTable(); ctst_freeAll(); diff --git a/icu4c/source/test/cintltst/citertst.c b/icu4c/source/test/cintltst/citertst.c index 23a25c555d5..0f83d0e7a4d 100644 --- a/icu4c/source/test/cintltst/citertst.c +++ b/icu4c/source/test/cintltst/citertst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /* * Collation Iterator tests. * (Let me reiterate my position...) diff --git a/icu4c/source/test/cintltst/citertst.h b/icu4c/source/test/cintltst/citertst.h index b6fcfa3c1b9..15ba6713f74 100644 --- a/icu4c/source/test/cintltst/citertst.h +++ b/icu4c/source/test/cintltst/citertst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * Collation Iterator tests. diff --git a/icu4c/source/test/cintltst/cjaptst.c b/icu4c/source/test/cintltst/cjaptst.c index 86e84018549..58c07c60af2 100644 --- a/icu4c/source/test/cintltst/cjaptst.c +++ b/icu4c/source/test/cintltst/cjaptst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationKannaTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cjaptst.h b/icu4c/source/test/cintltst/cjaptst.h index 6867a554329..d4678be7687 100644 --- a/icu4c/source/test/cintltst/cjaptst.h +++ b/icu4c/source/test/cintltst/cjaptst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationKannaTest(JAPAN) is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cloctst.c b/icu4c/source/test/cintltst/cloctst.c index f8203f5a94a..bdf4ec8c10b 100644 --- a/icu4c/source/test/cintltst/cloctst.c +++ b/icu4c/source/test/cintltst/cloctst.c @@ -24,7 +24,63 @@ void PrintDataTable(); -static char* rawData2[23][5]; +/*--------------------------------------------------- + table of valid data + --------------------------------------------------- */ + + +static char* rawData2[23][5] = { + /* language code */ + { "en", "fr", "hr", "el", "no" }, + /* country code */ + { "US", "FR", "HR", "GR", "NO" }, + /* variant code */ + { "", "", "", "", "NY" }, + /* full name */ + { "en_US", "fr_FR", "hr_HR", "el_GR", "no_NO_NY" }, + /* ISO-3 language */ + { "eng", "fra", "hrv", "ell", "nor" }, + /* ISO-3 country */ + { "USA", "FRA", "HRV", "GRC", "NOR" }, + /* LCID (not currently public) */ + { "409", "40c", "41a", "408", "814" }, + + /* display langage (English) */ + { "English", "French", "Croatian", "Greek", "Norwegian" }, + /* display country (English) */ + { "United States", "France", "Croatia", "Greece", "Norway" }, + /* display variant (English) */ + { "", "", "", "", "Nynorsk" }, + /* display name (English) */ + { "English (United States)", "French (France)", "Croatian (Croatia)", "Greek (Greece)", "Norwegian (Norway, Nynorsk)" }, + + /* display langage (French) */ + { "anglais", "fran\\u00E7ais", "", "grec", "norv\\u00E9gien" }, + /* display country (French) */ + { "\\u00C9tats-Unis", "France", "", "Gr\\u00E8ce", "Norv\\u00E8ge" }, + /* display variant (French) */ + { "", "", "", "", "Nynorsk" }, + /* display name (French) */ + { "anglais (\\u00C9tats-Unis)", "fran\\u00E7ais (France)", "", "grec (Gr\\u00E8ce)", "norv\\u00E9gien (Norv\\u00E8ge, Nynorsk)" }, + + /* display langage (Croatian) */ + { "", "", "hrvatski", "", "" }, + /* display country (Croatian) */ + { "", "", "Hrvatska", "", "" }, + /* display variant (Croatian) */ + { "", "", "", "", "" }, + /* display name (Croatian) */ + { "", "", "hrvatski (Hrvatska)", "", "" }, + + /* display langage (Greek) [actual values listed below] */ + { "", "", "", "", "" }, + /* display country (Greek) [actual values listed below] */ + { "", "", "", "", "" }, + /* display variant (Greek) */ + { "", "", "", "", "" }, + /* display name (Greek) [actual values listed below] */ + { "", "", "", "", "" } +}; static UChar*** dataTable=0; enum { @@ -608,64 +664,6 @@ void TestISOFunctions() -/*--------------------------------------------------- - table of valid data - --------------------------------------------------- */ - - -static char* rawData2[23][5] = { - /* language code */ - { "en", "fr", "hr", "el", "no" }, - /* country code */ - { "US", "FR", "HR", "GR", "NO" }, - /* variant code */ - { "", "", "", "", "NY" }, - /* full name */ - { "en_US", "fr_FR", "hr_HR", "el_GR", "no_NO_NY" }, - /* ISO-3 language */ - { "eng", "fra", "hrv", "ell", "nor" }, - /* ISO-3 country */ - { "USA", "FRA", "HRV", "GRC", "NOR" }, - /* LCID (not currently public) */ - { "409", "40c", "41a", "408", "814" }, - - /* display langage (English) */ - { "English", "French", "Croatian", "Greek", "Norwegian" }, - /* display country (English) */ - { "United States", "France", "Croatia", "Greece", "Norway" }, - /* display variant (English) */ - { "", "", "", "", "Nynorsk" }, - /* display name (English) */ - { "English (United States)", "French (France)", "Croatian (Croatia)", "Greek (Greece)", "Norwegian (Norway, Nynorsk)" }, - - /* display langage (French) */ - { "anglais", "fran\\u00E7ais", "", "grec", "norv\\u00E9gien" }, - /* display country (French) */ - { "\\u00C9tats-Unis", "France", "", "Gr\\u00E8ce", "Norv\\u00E8ge" }, - /* display variant (French) */ - { "", "", "", "", "Nynorsk" }, - /* display name (French) */ - { "anglais (\\u00C9tats-Unis)", "fran\\u00E7ais (France)", "", "grec (Gr\\u00E8ce)", "norv\\u00E9gien (Norv\\u00E8ge, Nynorsk)" }, - - /* display langage (Croatian) */ - { "", "", "hrvatski", "", "" }, - /* display country (Croatian) */ - { "", "", "Hrvatska", "", "" }, - /* display variant (Croatian) */ - { "", "", "", "", "" }, - /* display name (Croatian) */ - { "", "", "hrvatski (Hrvatska)", "", "" }, - - /* display langage (Greek) [actual values listed below] */ - { "", "", "", "", "" }, - /* display country (Greek) [actual values listed below] */ - { "", "", "", "", "" }, - /* display variant (Greek) */ - { "", "", "", "", "" }, - /* display name (Greek) [actual values listed below] */ - { "", "", "", "", "" } -}; - static UChar greekDisplayLanguage[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03b9, 0x03ba, 0x03ac, 0 }; static UChar greekDisplayCountry[] = { 0x0395, 0x03bb, 0x03bb, 0x03ac, 0x03b4, 0x03b1, 0 }; static UChar greekDisplayName[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03b9, 0x03ba, @@ -675,10 +673,10 @@ static UChar greekDisplayName[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03 void setUpDataTable() { int32_t i,j; - dataTable = calloc(sizeof(UChar**),23); + dataTable = (UChar***)(calloc(sizeof(UChar**),23)); for (i = 0; i < 23; i++) { - dataTable[i] = calloc(sizeof(UChar*),5); + dataTable[i] = (UChar**)(calloc(sizeof(UChar*),5)); for (j = 0; j < 5; j++){ dataTable[i][j] = CharsToUChars(rawData2[i][j]); } diff --git a/icu4c/source/test/cintltst/cloctst.h b/icu4c/source/test/cintltst/cloctst.h index d8c6ea5739f..c3eef751c6f 100644 --- a/icu4c/source/test/cintltst/cloctst.h +++ b/icu4c/source/test/cintltst/cloctst.h @@ -22,7 +22,7 @@ static void addLocaleTests(TestNode**); /** Test functions to set and get data fields - /**/ + **/ static void TestBasicGetters(void); /** * Use Locale to access Resource file data and compare against expected values diff --git a/icu4c/source/test/cintltst/cnormtst.c b/icu4c/source/test/cintltst/cnormtst.c index f3593cacc36..42fa59fb524 100644 --- a/icu4c/source/test/cintltst/cnormtst.c +++ b/icu4c/source/test/cintltst/cnormtst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /*tests for u_normalization*/ #include "unicode/utypes.h" #include "unicode/ucol.h" diff --git a/icu4c/source/test/cintltst/cnumtst.c b/icu4c/source/test/cintltst/cnumtst.c index 24cffa04950..bae15bc67da 100644 --- a/icu4c/source/test/cintltst/cnumtst.c +++ b/icu4c/source/test/cintltst/cnumtst.c @@ -395,14 +395,14 @@ free(temp1); for(i = 0; i < UNUM_FORMAT_SYMBOL_COUNT; ++i) { symbol[0] = (UChar)(0x41 + i); symbol[1] = (UChar)(0x61 + i); - unum_setSymbol(cur_frpattern, i, symbol, 2, &status); + unum_setSymbol(cur_frpattern, (UNumberFormatSymbol)i, symbol, 2, &status); if(U_FAILURE(status)) { log_err("Error from unum_setSymbol(%d): %s\n", i, myErrorName(status)); return; } } for(i = 0; i < UNUM_FORMAT_SYMBOL_COUNT; ++i) { - resultlength = unum_getSymbol(cur_frpattern, i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status); + resultlength = unum_getSymbol(cur_frpattern, (UNumberFormatSymbol)i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status); if(U_FAILURE(status)) { log_err("Error from unum_getSymbol(%d): %s\n", i, myErrorName(status)); return; @@ -412,7 +412,7 @@ free(temp1); } } /*try getting from a bogus symbol*/ - unum_getSymbol(cur_frpattern, i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status); + unum_getSymbol(cur_frpattern, (UNumberFormatSymbol)i, symbol, sizeof(symbol)/U_SIZEOF_UCHAR, &status); if(U_SUCCESS(status)){ log_err("Error : Expected U_ILLEGAL_ARGUMENT_ERROR for bogus symbol"); } diff --git a/icu4c/source/test/cintltst/cturtst.c b/icu4c/source/test/cintltst/cturtst.c index 182a67ca23e..18abadf2177 100644 --- a/icu4c/source/test/cintltst/cturtst.c +++ b/icu4c/source/test/cintltst/cturtst.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationTurkishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cturtst.h b/icu4c/source/test/cintltst/cturtst.h index c3b51f3b69b..e0650ce5de2 100644 --- a/icu4c/source/test/cintltst/cturtst.h +++ b/icu4c/source/test/cintltst/cturtst.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationTurkishTest(JAPAN) is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/cucdtst.c b/icu4c/source/test/cintltst/cucdtst.c index f315f4c4085..10d219c206b 100644 --- a/icu4c/source/test/cintltst/cucdtst.c +++ b/icu4c/source/test/cintltst/cucdtst.c @@ -590,10 +590,10 @@ void setUpDataTable() { int32_t i,j; if(dataTable == NULL) { - dataTable = calloc(sizeof(UChar**),3); + dataTable = (UChar***)calloc(sizeof(UChar**),3); for (i = 0; i < 3; i++) { - dataTable[i] = calloc(sizeof(UChar*),4); + dataTable[i] = (UChar**)calloc(sizeof(UChar*),4); for (j = 0; j < 4; j++){ dataTable[i][j] = (UChar*) malloc(sizeof(UChar)*(strlen(raw[i][j])+1)); u_uastrcpy(dataTable[i][j],raw[i][j]); diff --git a/icu4c/source/test/cintltst/encoll.c b/icu4c/source/test/cintltst/encoll.c index 82258259147..9b2db5a9bc7 100644 --- a/icu4c/source/test/cintltst/encoll.c +++ b/icu4c/source/test/cintltst/encoll.c @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Ported for C API -********************************************************************************* +*********************************************************************************/ /** * CollationEnglishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/encoll.h b/icu4c/source/test/cintltst/encoll.h index b83bc529163..2b153fb4836 100644 --- a/icu4c/source/test/cintltst/encoll.h +++ b/icu4c/source/test/cintltst/encoll.h @@ -10,7 +10,7 @@ * Modification History: * Name Description * Madhu Katragadda Converted to C -********************************************************************************* +*********************************************************************************/ /** * CollationEnglishTest is a third level test class. This tests the locale * specific primary, secondary and tertiary rules. For example, the ignorable diff --git a/icu4c/source/test/cintltst/ncnvfbts.c b/icu4c/source/test/cintltst/ncnvfbts.c index b5e12d63127..ff3a1d8ca9a 100644 --- a/icu4c/source/test/cintltst/ncnvfbts.c +++ b/icu4c/source/test/cintltst/ncnvfbts.c @@ -220,7 +220,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t } log_verbose(junk); - printSeq(expect, expectLen); + printSeq((const unsigned char*)expect, expectLen); if ( checkOffsets ) { log_verbose("\nOffsets:"); @@ -235,8 +235,8 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t { log_err("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName); log_verbose("Expected %d chars out, got %d %s\n", expectLen, targ-junkout, gNuConvTestName); - printSeqErr(junkout, targ-junkout); - printSeqErr(expect, expectLen); + printSeqErr((const unsigned char*)junkout, targ-junkout); + printSeqErr((const unsigned char*)expect, expectLen); return FALSE; } @@ -246,7 +246,7 @@ UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t if(memcmp(junokout,expectOffsets,(targ-junkout) * sizeof(int32_t) )){ log_err("\ndid not get the expected offsets while %s \n", gNuConvTestName); log_err("Got : "); - printSeqErr(junkout, targ-junkout); + printSeqErr((const unsigned char*)junkout, targ-junkout); for(p=junkout;p -void printUChars(UChar *uchars); +void printUChars(const UChar *uchars); void TestCodeUnitValues(); void TestCharLength(); @@ -409,7 +409,7 @@ void TestAppendChar(){ 4 }; - static uint16_t result[][5]={ + static UChar result[][5]={ /*unsafe*/ {0xd841, 0xdc41, 0x0063, 0x0064, 0x0000}, {0x0061, 0x0062, 0x0028, 0x0064, 0x0000}, @@ -429,7 +429,7 @@ void TestAppendChar(){ }; uint16_t i, count=0; - UChar *str=malloc(sizeof(UChar) * (u_strlen(s)+1)); + UChar *str=(UChar*)malloc(sizeof(UChar) * (u_strlen(s)+1)); uint16_t offset; for(i=0; i