diff --git a/icu4c/source/test/cintltst/callcoll.c b/icu4c/source/test/cintltst/callcoll.c index b71ed416fd2..7cf0709f9c9 100644 --- a/icu4c/source/test/cintltst/callcoll.c +++ b/icu4c/source/test/cintltst/callcoll.c @@ -413,7 +413,7 @@ void addAllCollTest(TestNode** root) addTest(root, &TestJB581, "tscoll/callcoll/TestJB581"); } -void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) +static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; int32_t temp; @@ -444,7 +444,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[], free(sortKey2); } -void TestTertiary() +static void TestTertiary() { int32_t len,i; UChar *rules, *newRules; @@ -473,7 +473,7 @@ void TestTertiary() myCollation = 0; } -void TestPrimary( ) +static void TestPrimary( ) { int32_t len,i; UChar *rules, *newRules; @@ -505,7 +505,7 @@ void TestPrimary( ) myCollation = 0; } -void TestSecondary() +static void TestSecondary() { int32_t i; int32_t len; @@ -535,7 +535,8 @@ void TestSecondary() ucol_close(myCollation); myCollation = 0; } -void TestIdentical() + +static void TestIdentical() { int32_t i; int32_t len; @@ -564,7 +565,8 @@ void TestIdentical() ucol_close(myCollation); myCollation = 0; } -void TestExtra() + +static void TestExtra() { int32_t i, j; int32_t len; @@ -600,18 +602,18 @@ void TestExtra() myCollation = 0; } -void TestJB581(void) +static void TestJB581(void) { - UChar dispName [100]; - int32_t bufferLen = 0; - UChar source [100]; - UChar target [100]; - UCollationResult result = UCOL_EQUAL; - uint8_t sourceKeyArray [100]; - uint8_t targetKeyArray [100]; - int32_t sourceKeyOut = 0, - targetKeyOut = 0; - UCollator *myCollator = 0; + UChar dispName [100]; + int32_t bufferLen = 0; + UChar source [100]; + UChar target [100]; + UCollationResult result = UCOL_EQUAL; + uint8_t sourceKeyArray [100]; + uint8_t targetKeyArray [100]; + int32_t sourceKeyOut = 0, + targetKeyOut = 0; + UCollator *myCollator = 0; UErrorCode status = U_ZERO_ERROR; u_uastrcpy(source, "This is a test."); diff --git a/icu4c/source/test/cintltst/capitst.c b/icu4c/source/test/cintltst/capitst.c index 160cd4eaefb..895da53ce3c 100644 --- a/icu4c/source/test/cintltst/capitst.c +++ b/icu4c/source/test/cintltst/capitst.c @@ -384,13 +384,13 @@ void TestSortKey() if(ucol_getNormalization(col) != UCOL_DEFAULT_NORMALIZATION) { - log_err("ERROR: default collation did not have UCOL_DEFAULT_NORMALIZATION !\n"); + log_err("ERROR: default collation did not have UCOL_DEFAULT_NORMALIZATION !\n"); } if(ucol_getStrength(col) != UCOL_DEFAULT_STRENGTH) { - log_err("ERROR: default collation did not have UCOL_DEFAULT_STRENGTH !\n"); + log_err("ERROR: default collation did not have UCOL_DEFAULT_STRENGTH !\n"); } test1=(UChar*)malloc(sizeof(UChar) * 6); @@ -442,10 +442,10 @@ void TestSortKey() strcpy(junk3, " abcda[3] "); for(i=0;i> 8) | (myUChar << 8))); /*adjust if BIG_ENDIAN*/ } - myUChar = ucs_file_buffer[i-1]; - ucs_file_buffer[i-1] = (UChar)((BOM==0xFEFF)?myUChar:((myUChar >> 8) | (myUChar << 8))); /*adjust if BIG_ENDIAN Corner Case*/ + myUChar = ucs_file_buffer[i-1]; + ucs_file_buffer[i-1] = (UChar)((BOM==0xFEFF)?myUChar:((myUChar >> 8) | (myUChar << 8))); /*adjust if BIG_ENDIAN Corner Case*/ - /*testing ucnv_fromUChars() and ucnv_toUChars() */ - /*uchar1---fromUChar--->output_cp_buffer --toUChar--->uchar2*/ + /*testing ucnv_fromUChars() and ucnv_toUChars() */ + /*uchar1---fromUChar--->output_cp_buffer --toUChar--->uchar2*/ - uchar1=(UChar*)malloc(sizeof(UChar) * (u_strlen(ucs_file_buffer)+1)); - u_uastrcpy(uchar1,""); - u_strncpy(uchar1,ucs_file_buffer,i); + uchar1=(UChar*)malloc(sizeof(UChar) * (u_strlen(ucs_file_buffer)+1)); + u_uastrcpy(uchar1,""); + u_strncpy(uchar1,ucs_file_buffer,i); - uchar3=(UChar*)malloc(sizeof(UChar)*(u_strlen(ucs_file_buffer)+1)); - u_uastrcpy(uchar3,""); - u_strncpy(uchar3,ucs_file_buffer,i); - - /*Calls the Conversion Routine */ - testLong1 = MAX_FILE_LEN; - log_verbose("\n---Testing ucnv_fromUChars()\n"); - targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, testLong1, uchar1, -1, &err); - if (U_FAILURE(err)) - { + uchar3=(UChar*)malloc(sizeof(UChar)*(u_strlen(ucs_file_buffer)+1)); + u_uastrcpy(uchar3,""); + u_strncpy(uchar3,ucs_file_buffer,i); + + /*Calls the Conversion Routine */ + testLong1 = MAX_FILE_LEN; + log_verbose("\n---Testing ucnv_fromUChars()\n"); + targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, testLong1, uchar1, -1, &err); + if (U_FAILURE(err)) + { log_err("\nFAILURE...%s\n", myErrorName(err)); - } - else - log_verbose(" ucnv_fromUChars() o.k.\n"); - /*the codepage intermediate buffer should be null terminated */ - output_cp_buffer[targetcapacity]='\0'; - - /*test the conversion routine */ - log_verbose("\n---Testing ucnv_toUChars()\n"); - /*call it first time for trapping the targetcapacity and size needed to allocate memory for the buffer uchar2 */ - targetcapacity2=0; - targetsize = ucnv_toUChars(myConverter, - NULL, - targetcapacity2, - output_cp_buffer, - strlen(output_cp_buffer), - &err); - /*if there is an buffer overflow then trap the values and pass them and make the actual call*/ + } + else + log_verbose(" ucnv_fromUChars() o.k.\n"); + /*the codepage intermediate buffer should be null terminated */ + output_cp_buffer[targetcapacity]='\0'; - if(err==U_BUFFER_OVERFLOW_ERROR) - { - err=U_ZERO_ERROR; - uchar2=(UChar*)malloc((targetsize) * sizeof(UChar)); - targetsize = ucnv_toUChars(myConverter, + /*test the conversion routine */ + log_verbose("\n---Testing ucnv_toUChars()\n"); + /*call it first time for trapping the targetcapacity and size needed to allocate memory for the buffer uchar2 */ + targetcapacity2=0; + targetsize = ucnv_toUChars(myConverter, + NULL, + targetcapacity2, + output_cp_buffer, + strlen(output_cp_buffer), + &err); + /*if there is an buffer overflow then trap the values and pass them and make the actual call*/ + + if(err==U_BUFFER_OVERFLOW_ERROR) + { + err=U_ZERO_ERROR; + uchar2=(UChar*)malloc((targetsize) * sizeof(UChar)); + targetsize = ucnv_toUChars(myConverter, uchar2, targetsize, output_cp_buffer, strlen(output_cp_buffer), &err); - - if(U_FAILURE(err)) - log_err("ucnv_toUChars() FAILED %s\n", myErrorName(err)); - else - log_verbose(" ucnv_toUChars() o.k.\n"); - if(u_strcmp(uchar1,uchar2)!=0) - log_err("equality test failed with convertion routine\n"); - } - else - { - log_err("ERR: calling toUChars: Didn't get U_BUFFER_OVERFLOW .. expected it.\n"); - } - /*Testing ucnv_fromUChars and ucnv_toUChars with error conditions*/ - err=U_ILLEGAL_ARGUMENT_ERROR; - log_verbose("\n---Testing ucnv_fromUChars() with err != U_ZERO_ERROR\n"); - targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, testLong1, uchar1, -1, &err); - if (targetcapacity !=0) { + if(U_FAILURE(err)) + log_err("ucnv_toUChars() FAILED %s\n", myErrorName(err)); + else + log_verbose(" ucnv_toUChars() o.k.\n"); + + if(u_strcmp(uchar1,uchar2)!=0) + log_err("equality test failed with convertion routine\n"); + } + else + { + log_err("ERR: calling toUChars: Didn't get U_BUFFER_OVERFLOW .. expected it.\n"); + } + /*Testing ucnv_fromUChars and ucnv_toUChars with error conditions*/ + err=U_ILLEGAL_ARGUMENT_ERROR; + log_verbose("\n---Testing ucnv_fromUChars() with err != U_ZERO_ERROR\n"); + targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, testLong1, uchar1, -1, &err); + if (targetcapacity !=0) { log_err("\nFAILURE: ucnv_fromUChars with err != U_ZERO_ERROR is expected to fail and return 0\n"); - } - err=U_ZERO_ERROR; - log_verbose("\n---Testing ucnv_fromUChars() with converter=NULL\n"); - targetcapacity = ucnv_fromUChars(NULL, output_cp_buffer, testLong1, uchar1, -1, &err); - if (targetcapacity !=0 || err != U_ILLEGAL_ARGUMENT_ERROR) { + } + err=U_ZERO_ERROR; + log_verbose("\n---Testing ucnv_fromUChars() with converter=NULL\n"); + targetcapacity = ucnv_fromUChars(NULL, output_cp_buffer, testLong1, uchar1, -1, &err); + if (targetcapacity !=0 || err != U_ILLEGAL_ARGUMENT_ERROR) { log_err("\nFAILURE: ucnv_fromUChars with converter=NULL is expected to fail\n"); - } - err=U_ZERO_ERROR; - log_verbose("\n---Testing ucnv_fromUChars() with sourceLength = 0\n"); - targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, testLong1, uchar1, 0, &err); - if (targetcapacity !=0) { + } + err=U_ZERO_ERROR; + log_verbose("\n---Testing ucnv_fromUChars() with sourceLength = 0\n"); + targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, testLong1, uchar1, 0, &err); + if (targetcapacity !=0) { log_err("\nFAILURE: ucnv_fromUChars with sourceLength is expected to fail and return 0\n"); - } - log_verbose("\n---Testing ucnv_fromUChars() with targetLenth = 0\n"); - targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, 0, uchar1, -1, &err); - if (err != U_BUFFER_OVERFLOW_ERROR) { + } + log_verbose("\n---Testing ucnv_fromUChars() with targetLenth = 0\n"); + targetcapacity = ucnv_fromUChars(myConverter, output_cp_buffer, 0, uchar1, -1, &err); + if (err != U_BUFFER_OVERFLOW_ERROR) { log_err("\nFAILURE: ucnv_fromUChars with targetLength is expected to fail and throw U_BUFFER_OVERFLOW_ERROR\n"); - } - /*toUChars with error conditions*/ - targetsize = ucnv_toUChars(myConverter, uchar2, targetsize, output_cp_buffer, strlen(output_cp_buffer), &err); - if(targetsize != 0){ - log_err("\nFAILURE: ucnv_toUChars with err != U_ZERO_ERROR is expected to fail and return 0\n"); - } - err=U_ZERO_ERROR; - targetsize = ucnv_toUChars(myConverter, uchar2, -1, output_cp_buffer, strlen(output_cp_buffer), &err); - if(targetsize != 0 || err != U_ILLEGAL_ARGUMENT_ERROR){ - log_err("\nFAILURE: ucnv_toUChars with targetsize < 0 is expected to throw U_ILLEGAL_ARGUMENT_ERROR and return 0\n"); - } - err=U_ZERO_ERROR; - targetsize = ucnv_toUChars(myConverter, uchar2, 0, output_cp_buffer, 0, &err); - if (targetsize !=0) { + } + /*toUChars with error conditions*/ + targetsize = ucnv_toUChars(myConverter, uchar2, targetsize, output_cp_buffer, strlen(output_cp_buffer), &err); + if(targetsize != 0){ + log_err("\nFAILURE: ucnv_toUChars with err != U_ZERO_ERROR is expected to fail and return 0\n"); + } + err=U_ZERO_ERROR; + targetsize = ucnv_toUChars(myConverter, uchar2, -1, output_cp_buffer, strlen(output_cp_buffer), &err); + if(targetsize != 0 || err != U_ILLEGAL_ARGUMENT_ERROR){ + log_err("\nFAILURE: ucnv_toUChars with targetsize < 0 is expected to throw U_ILLEGAL_ARGUMENT_ERROR and return 0\n"); + } + err=U_ZERO_ERROR; + targetsize = ucnv_toUChars(myConverter, uchar2, 0, output_cp_buffer, 0, &err); + if (targetsize !=0) { log_err("\nFAILURE: ucnv_toUChars with sourceLength is expected to fail and return 0\n"); - } - targetcapacity2=0; - targetsize = ucnv_toUChars(myConverter, NULL, targetcapacity2, output_cp_buffer, strlen(output_cp_buffer), &err); - if (err != U_BUFFER_OVERFLOW_ERROR) { + } + targetcapacity2=0; + targetsize = ucnv_toUChars(myConverter, NULL, targetcapacity2, output_cp_buffer, strlen(output_cp_buffer), &err); + if (err != U_BUFFER_OVERFLOW_ERROR) { log_err("\nFAILURE: ucnv_toUChars with targetLength is expected to fail and throw U_BUFFER_OVERFLOW_ERROR\n"); - } - err=U_ZERO_ERROR; - /*-----*/ + } + err=U_ZERO_ERROR; + /*-----*/ - /*testing for ucnv_fromUnicode() and ucnv_toUnicode() */ - /*Clean up re-usable vars*/ - j=0; - log_verbose("Testing ucnv_fromUnicode().....\n"); - tmp_ucs_buf=ucs_file_buffer_use; - ucnv_fromUnicode(myConverter, &mytarget_1, + /*testing for ucnv_fromUnicode() and ucnv_toUnicode() */ + /*Clean up re-usable vars*/ + j=0; + log_verbose("Testing ucnv_fromUnicode().....\n"); + tmp_ucs_buf=ucs_file_buffer_use; + ucnv_fromUnicode(myConverter, &mytarget_1, mytarget + MAX_FILE_LEN, &tmp_ucs_buf, ucs_file_buffer_use+i, NULL, TRUE, &err); - consumedUni = (UChar*)tmp_consumedUni; - - if (U_FAILURE(err)) - { - log_err("FAILURE! %s\n", myErrorName(err)); - } - else - log_verbose("ucnv_fromUnicode() o.k.\n"); + consumedUni = (UChar*)tmp_consumedUni; - /*Uni1 ----ToUnicode----> Cp2 ----FromUnicode---->Uni3 */ - log_verbose("Testing ucnv_toUnicode().....\n"); - tmp_mytarget_use=mytarget_use; - tmp_consumed = consumed; - ucnv_toUnicode(myConverter, &my_ucs_file_buffer_1, - my_ucs_file_buffer + MAX_FILE_LEN, - &tmp_mytarget_use, - mytarget_use+strlen((char*)mytarget_use), - NULL, - FALSE, - &err); - consumed = (char*)tmp_consumed; - if (U_FAILURE(err)) - { log_err("FAILURE! %s\n", myErrorName(err)); } - else - log_verbose("ucnv_toUnicode() o.k.\n"); - - - log_verbose("\n---Testing RoundTrip ...\n"); - - - u_strncpy(uchar3, my_ucs_file_buffer,i); - - if(u_strcmp(uchar1,uchar3)==0) - log_verbose("Equality test o.k.\n"); - else - log_err("Equality test failed\n"); + if (U_FAILURE(err)) + { + log_err("FAILURE! %s\n", myErrorName(err)); + } + else + log_verbose("ucnv_fromUnicode() o.k.\n"); - /*sanity compare */ - if(uchar2 == NULL) - { - log_err("uchar2 was NULL (ccapitst.c line %d), couldn't do sanity check\n", __LINE__); - } - else - { - if(u_strcmp(uchar2, uchar3)==0) - log_verbose("Equality test o.k.\n"); - else - log_err("Equality test failed\n"); - } + /*Uni1 ----ToUnicode----> Cp2 ----FromUnicode---->Uni3 */ + log_verbose("Testing ucnv_toUnicode().....\n"); + tmp_mytarget_use=mytarget_use; + tmp_consumed = consumed; + ucnv_toUnicode(myConverter, &my_ucs_file_buffer_1, + my_ucs_file_buffer + MAX_FILE_LEN, + &tmp_mytarget_use, + mytarget_use+strlen((char*)mytarget_use), + NULL, + FALSE, + &err); + consumed = (char*)tmp_consumed; + if (U_FAILURE(err)) + { + log_err("FAILURE! %s\n", myErrorName(err)); + } + else + log_verbose("ucnv_toUnicode() o.k.\n"); - fclose(ucs_file_in); - ucnv_close(myConverter); - free(displayname); - if (uchar1 != 0) free(uchar1); - if (uchar2 != 0) free(uchar2); - if (uchar3 != 0) free(uchar3); + + log_verbose("\n---Testing RoundTrip ...\n"); + + + u_strncpy(uchar3, my_ucs_file_buffer,i); + + if(u_strcmp(uchar1,uchar3)==0) + log_verbose("Equality test o.k.\n"); + else + log_err("Equality test failed\n"); + + /*sanity compare */ + if(uchar2 == NULL) + { + log_err("uchar2 was NULL (ccapitst.c line %d), couldn't do sanity check\n", __LINE__); + } + else + { + if(u_strcmp(uchar2, uchar3)==0) + log_verbose("Equality test o.k.\n"); + else + log_err("Equality test failed\n"); + } + + fclose(ucs_file_in); + ucnv_close(myConverter); + free(displayname); + if (uchar1 != 0) free(uchar1); + if (uchar2 != 0) free(uchar2); + if (uchar3 != 0) free(uchar3); } - + free((void*)mytarget); free((void*)output_cp_buffer); free((void*)ucs_file_buffer); @@ -953,26 +975,24 @@ void TestConvert() void WriteToFile(const UChar *a, FILE *myfile) { - uint32_t size = u_strlen(a); - uint16_t i = 0; - UChar b = 0xFEFF; + uint32_t size = u_strlen(a); + uint16_t i = 0; + UChar b = 0xFEFF; - /*Writes the BOM*/ - fwrite(&b, sizeof(UChar), 1, myfile); - for (i=0; i< size; i++) - { - b = a[i]; - fwrite(&b, sizeof(UChar), 1, myfile); - } - return; + /*Writes the BOM*/ + fwrite(&b, sizeof(UChar), 1, myfile); + for (i=0; i< size; i++) + { + b = a[i]; + fwrite(&b, sizeof(UChar), 1, myfile); + } } - int32_t strCaseIcmp(const char* a1, const char * a2) { int32_t i=0, ret=0; while(a1[i]&&a2[i]) - { + { ret += tolower(a1[i])-tolower(a2[i]); i++; } @@ -986,7 +1006,6 @@ UConverterFromUCallback otherUnicodeAction(UConverterFromUCallback MIA) UConverterToUCallback otherCharAction(UConverterToUCallback MIA) - { return (MIA==(UConverterToUCallback)UCNV_TO_U_CALLBACK_STOP)?(UConverterToUCallback)UCNV_TO_U_CALLBACK_SUBSTITUTE:(UConverterToUCallback)UCNV_TO_U_CALLBACK_STOP; } @@ -998,7 +1017,7 @@ UConverterToUCallback otherCharAction(UConverterToUCallback MIA) * aliases map back to itself. Check some hard-coded UTF8 and * ISO_2022 aliases to make sure they work. */ -void TestAlias() { +static void TestAlias() { int32_t i, ncnv; UErrorCode status = U_ZERO_ERROR; diff --git a/icu4c/source/test/cintltst/cconvtst.c b/icu4c/source/test/cintltst/cconvtst.c index eee07890bdc..47885a0d499 100644 --- a/icu4c/source/test/cintltst/cconvtst.c +++ b/icu4c/source/test/cintltst/cconvtst.c @@ -24,8 +24,8 @@ void addExtraTests(TestNode** root); void addConvert(TestNode** root) { addTestConvert(root); - addTestNewConvert(root); - addTestConvertErrorCallBack(root); + addTestNewConvert(root); + addTestConvertErrorCallBack(root); addTestEuroRegression(root); addTestConverterFallBack(root); addExtraTests(root); diff --git a/icu4c/source/test/cintltst/cdantst.c b/icu4c/source/test/cintltst/cdantst.c index d1f24680d1e..718f7ec8513 100644 --- a/icu4c/source/test/cintltst/cdantst.c +++ b/icu4c/source/test/cintltst/cdantst.c @@ -189,7 +189,7 @@ void addDanishCollTest(TestNode** root) -void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) +static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; int32_t temp; @@ -220,7 +220,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[], free(sortKey2); } -void TestTertiary( ) +static void TestTertiary( ) { int32_t i,j; @@ -247,12 +247,11 @@ void TestTertiary( ) doTest(myCollation, testNTList[i], testNTList[j], UCOL_LESS); } } -ucol_close(myCollation); + ucol_close(myCollation); } -void TestPrimary() +static void TestPrimary() { - int32_t i; UErrorCode status = U_ZERO_ERROR; myCollation = ucol_open("da_DK", &status); @@ -264,6 +263,6 @@ void TestPrimary() { doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]); } - ucol_close(myCollation); + ucol_close(myCollation); } diff --git a/icu4c/source/test/cintltst/cdattst.c b/icu4c/source/test/cintltst/cdattst.c index 310d56e7cd8..8e9093e07a2 100644 --- a/icu4c/source/test/cintltst/cdattst.c +++ b/icu4c/source/test/cintltst/cdattst.c @@ -35,7 +35,7 @@ void addDateForTest(TestNode** root) addTest(root, &TestSymbols, "tsformat/cdattst/TestSymbols"); } /* Testing the DateFormat API */ -void TestDateFormat() +static void TestDateFormat() { UDateFormat *def, *fr, *it, *de, *def1, *fr_pat; UDateFormat *copy; @@ -308,7 +308,7 @@ void TestDateFormat() } /*Testing udat_getSymbols() and udat_setSymbols() and udat_countSymbols()*/ -void TestSymbols() +static void TestSymbols() { UDateFormat *def, *fr; UErrorCode status = U_ZERO_ERROR; @@ -523,7 +523,7 @@ free(pattern); } /*INTERNAL FUNCTIONS USED*/ -void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected) +static void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected) { UChar *pattern=NULL; UErrorCode status = U_ZERO_ERROR; @@ -558,7 +558,7 @@ void VerifygetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i free(pattern); } -void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected) +static void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t index, const char* expected) { UChar *result=NULL; UChar *value=NULL; @@ -600,7 +600,7 @@ void VerifysetSymbols(UDateFormat* datfor, UDateFormatSymbolType type, int32_t i } -void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolType type, int32_t index) +static void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolType type, int32_t index) { UChar *result=NULL; UChar *value=NULL; @@ -654,8 +654,7 @@ void VerifygetsetSymbols(UDateFormat* from, UDateFormat* to, UDateFormatSymbolTy } - -UChar* myNumformat(const UNumberFormat* numfor, double d) +static UChar* myNumformat(const UNumberFormat* numfor, double d) { UChar *result2=NULL; int32_t resultlength, resultlengthneeded; diff --git a/icu4c/source/test/cintltst/cdattst.h b/icu4c/source/test/cintltst/cdattst.h index d1d13d44923..1299eb0380a 100644 --- a/icu4c/source/test/cintltst/cdattst.h +++ b/icu4c/source/test/cintltst/cdattst.h @@ -31,13 +31,13 @@ /** * test subroutines used by TestSymbols **/ - void VerifygetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*); - void VerifysetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*); - void VerifygetsetSymbols(UDateFormat*, UDateFormat*, UDateFormatSymbolType, int32_t); + static void VerifygetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*); + static void VerifysetSymbols(UDateFormat*, UDateFormatSymbolType, int32_t, const char*); + static void VerifygetsetSymbols(UDateFormat*, UDateFormat*, UDateFormatSymbolType, int32_t); /** * test subroutine used by the testing functions **/ - UChar* myNumformat(const UNumberFormat* numfor, double d); + static UChar* myNumformat(const UNumberFormat* numfor, double d); #endif diff --git a/icu4c/source/test/cintltst/cdetst.c b/icu4c/source/test/cintltst/cdetst.c index 0fd4a5bdfb7..aa39533efda 100644 --- a/icu4c/source/test/cintltst/cdetst.c +++ b/icu4c/source/test/cintltst/cdetst.c @@ -91,7 +91,8 @@ void addGermanCollTest(TestNode** root) } -void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) + +static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; int32_t temp; @@ -122,7 +123,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[], free(sortKey2); } -void TestTertiary( ) +static void TestTertiary( ) { int32_t i; @@ -141,7 +142,7 @@ void TestTertiary( ) ucol_close(myCollation); } -void TestPrimary() +static void TestPrimary() { int32_t i; diff --git a/icu4c/source/test/cintltst/cestst.c b/icu4c/source/test/cintltst/cestst.c index 6041cc637d9..fa3d628b148 100644 --- a/icu4c/source/test/cintltst/cestst.c +++ b/icu4c/source/test/cintltst/cestst.c @@ -75,7 +75,8 @@ void addSpanishCollTest(TestNode** root) addTest(root, &TestTertiary, "tscoll/cestst/TestTertiary"); } -void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) + +static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; int32_t temp; @@ -106,7 +107,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[], free(sortKey2); } -void TestTertiary( ) +static void TestTertiary( ) { int32_t i; @@ -124,7 +125,7 @@ void TestTertiary( ) ucol_close(myCollation); } -void TestPrimary() +static void TestPrimary() { int32_t i; diff --git a/icu4c/source/test/cintltst/cfintst.c b/icu4c/source/test/cintltst/cfintst.c index 4c9de55ed0e..64fee134cbd 100644 --- a/icu4c/source/test/cintltst/cfintst.c +++ b/icu4c/source/test/cintltst/cfintst.c @@ -66,7 +66,8 @@ void addFinnishCollTest(TestNode** root) } -void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) + +static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; int32_t temp; @@ -97,7 +98,7 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[], free(sortKey2); } -void TestTertiary( ) +static void TestTertiary( ) { int32_t i; @@ -115,7 +116,7 @@ void TestTertiary( ) ucol_close(myCollation); } -void TestPrimary() +static void TestPrimary() { int32_t i; diff --git a/icu4c/source/test/cintltst/cfrtst.c b/icu4c/source/test/cintltst/cfrtst.c index 7f480e69eae..509dc616719 100644 --- a/icu4c/source/test/cintltst/cfrtst.c +++ b/icu4c/source/test/cintltst/cfrtst.c @@ -136,7 +136,7 @@ void addFrenchCollTest(TestNode** root) } -void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) +static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; int32_t temp; @@ -159,15 +159,18 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[], temp= memcmp(sortKey1, sortKey2, sortklenmin); - if(temp < 0) keyResult=UCOL_LESS; - else if(temp > 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; + if(temp < 0) + keyResult=UCOL_LESS; + else if(temp > 0) + keyResult= UCOL_GREATER; + else + keyResult = UCOL_EQUAL; reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, result ); free(sortKey1); free(sortKey2); } -void TestTertiary( ) +static void TestTertiary( ) { int32_t i; @@ -182,10 +185,10 @@ void TestTertiary( ) { doTest(myCollation, testSourceCases[i], testTargetCases[i], results[i]); } - ucol_close(myCollation); + ucol_close(myCollation); } -void TestSecondary() +static void TestSecondary() { int32_t i,j, testAcuteSize; UCollationResult expected=UCOL_EQUAL; @@ -207,10 +210,10 @@ void TestSecondary() doTest(myCollation, testAcute[i], testAcute[j], expected ); } } -ucol_close(myCollation); + ucol_close(myCollation); } -void TestExtra() +static void TestExtra() { int32_t i, j; UErrorCode status = U_ZERO_ERROR; @@ -227,5 +230,5 @@ void TestExtra() doTest(myCollation, testBugs[i], testBugs[j], UCOL_LESS); } } -ucol_close(myCollation); + ucol_close(myCollation); } diff --git a/icu4c/source/test/cintltst/citertst.c b/icu4c/source/test/cintltst/citertst.c index 46f97da8b01..2cf675ec90b 100644 --- a/icu4c/source/test/cintltst/citertst.c +++ b/icu4c/source/test/cintltst/citertst.c @@ -49,7 +49,7 @@ void addCollIterTest(TestNode** root) * @bug 4108758 - Make sure it works with contracting characters * */ -void TestPrevious() +static void TestPrevious() { UChar rule[50]; UChar *source; @@ -144,7 +144,7 @@ void TestPrevious() /** * Test for getOffset() and setOffset() */ -void TestOffset() +static void TestOffset() { UErrorCode status= U_ZERO_ERROR; UCollationElements *iter, *pristine; @@ -205,7 +205,7 @@ void TestOffset() /** * Test for setText() */ -void TestSetText() +static void TestSetText() { int32_t c,i; UErrorCode status = U_ZERO_ERROR; @@ -259,14 +259,14 @@ void TestSetText() ucol_closeElements(iter2); ucol_closeElements(iter1); -ucol_close(en_us); + ucol_close(en_us); free(test1); free(test2); } -void backAndForth(UCollationElements *iter) +static void backAndForth(UCollationElements *iter) { /* Run through the iterator forwards and stick it into an array */ int32_t index, o; @@ -315,7 +315,7 @@ void backAndForth(UCollationElements *iter) /** @bug 4108762 * Test for getMaxExpansion() */ -void TestMaxExpansion() +static void TestMaxExpansion() { /* Try a simple one first: */ /* The only expansion ends with 'e' and has length 2 */ @@ -352,6 +352,7 @@ void TestMaxExpansion() u_uastrcpy(rule1, "< a & ae = a1 & aeef = z < b < e < f"); verifyExpansion(rule1, test2, ARRAY_LENGTH(test2)); } + /** * Verify that getMaxExpansion works on a given set of collation rules * @@ -363,7 +364,7 @@ void TestMaxExpansion() * and getMaxExpansion is called for that character. If its value is * not equal to the specified number, an error results. */ -void verifyExpansion(UChar* rules, const UChar expansionTests[], int32_t testCount) +static void verifyExpansion(UChar* rules, const UChar expansionTests[], int32_t testCount) { int32_t i; UErrorCode status = U_ZERO_ERROR; @@ -422,7 +423,7 @@ void verifyExpansion(UChar* rules, const UChar expansionTests[], int32_t testCou * Return an integer array containing all of the collation orders * returned by calls to next on the specified iterator */ -int32_t* getOrders(UCollationElements *iter, int32_t *orderLength) +static int32_t* getOrders(UCollationElements *iter, int32_t *orderLength) { UErrorCode status; int32_t order; @@ -469,7 +470,7 @@ int32_t* getOrders(UCollationElements *iter, int32_t *orderLength) } -void assertEqual(UCollationElements *i1, UCollationElements *i2) +static void assertEqual(UCollationElements *i1, UCollationElements *i2) { int32_t c1, c2; int32_t count = 0; diff --git a/icu4c/source/test/cintltst/citertst.h b/icu4c/source/test/cintltst/citertst.h index 15ba6713f74..fe28fcdc3cb 100644 --- a/icu4c/source/test/cintltst/citertst.h +++ b/icu4c/source/test/cintltst/citertst.h @@ -32,20 +32,20 @@ * @bug 4108758 - Make sure it works with contracting characters * */ - void TestPrevious(void); + static void TestPrevious(void); /** * Test for getOffset() and setOffset() */ - void TestOffset(void); + static void TestOffset(void); /** * Test for setText() */ - void TestSetText(void); + static void TestSetText(void); /** @bug 4108762 * Test for getMaxExpansion() */ - void TestMaxExpansion(void); + static void TestMaxExpansion(void); /*------------------------------------------------------------------------ @@ -57,7 +57,7 @@ /** * Verify that getMaxExpansion works on a given set of collation rules */ - void verifyExpansion(UChar* rules, const UChar tests[], int32_t testCount); + static void verifyExpansion(UChar* rules, const UChar tests[], int32_t testCount); /** diff --git a/icu4c/source/test/cintltst/cjaptst.c b/icu4c/source/test/cintltst/cjaptst.c index 73a21505850..aecd82ed91a 100644 --- a/icu4c/source/test/cintltst/cjaptst.c +++ b/icu4c/source/test/cintltst/cjaptst.c @@ -78,7 +78,8 @@ void addKannaCollTest(TestNode** root) addTest(root, &TestTertiary, "tscoll/cjacoll/TestTertiary"); } -void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) + +static void doTest(UCollator* myCollation, const UChar source[], const UChar target[], UCollationResult result) { int32_t sortklen1, sortklen2, sortklenmax, sortklenmin; int32_t temp; @@ -101,15 +102,18 @@ void doTest(UCollator* myCollation, const UChar source[], const UChar target[], temp= memcmp(sortKey1, sortKey2, sortklenmin); - if(temp < 0) keyResult=UCOL_LESS; - else if(temp > 0) keyResult= UCOL_GREATER; - else keyResult = UCOL_EQUAL; + if(temp < 0) + keyResult=UCOL_LESS; + else if(temp > 0) + keyResult= UCOL_GREATER; + else + keyResult = UCOL_EQUAL; reportCResult( source, target, sortKey1, sortKey2, compareResult, keyResult, result ); free(sortKey1); free(sortKey2); } -void TestTertiary( ) +static void TestTertiary( ) { int32_t i; @@ -129,4 +133,3 @@ void TestTertiary( ) } - diff --git a/icu4c/source/test/cintltst/cloctst.c b/icu4c/source/test/cintltst/cloctst.c index 6f51891762c..bf62b40a768 100644 --- a/icu4c/source/test/cintltst/cloctst.c +++ b/icu4c/source/test/cintltst/cloctst.c @@ -139,7 +139,7 @@ void addLocaleTest(TestNode** root) /* testing uloc(), uloc_getName(), uloc_getLanguage(), uloc_getVariant(), uloc_getCountry() */ -void TestBasicGetters() { +static void TestBasicGetters() { int32_t i; int32_t cap; UErrorCode status = U_ZERO_ERROR; @@ -216,8 +216,9 @@ void TestBasicGetters() { } } + /* testing uloc_getISO3Language(), uloc_getISO3Country(), */ -void TestSimpleResourceInfo() { +static void TestSimpleResourceInfo() { int32_t i; char* testLocale = 0; @@ -261,7 +262,8 @@ void TestSimpleResourceInfo() { free(expected); free(testLocale); } -void TestDisplayNames() + +static void TestDisplayNames() { /* sfb 990721 Can't just save a pointer to the default locale. @@ -303,7 +305,7 @@ void TestDisplayNames() log_verbose(" In locale = gr_EL..\n"); doTestDisplayNames("el_GR", DLANG_EL, FALSE); - uloc_setDefault("fr_FR", &err); + uloc_setDefault("fr_FR", &err); if (U_FAILURE(err)) { log_err("Locale::setDefault returned error code %s\n", myErrorName(err)); return; @@ -334,7 +336,7 @@ void TestDisplayNames() /* test for uloc_getAvialable() and uloc_countAvilable()*/ -void TestGetAvailableLocales() +static void TestGetAvailableLocales() { const char *locList; @@ -361,7 +363,7 @@ void TestGetAvailableLocales() } /* test for u_getDataDirectory, u_setDataDirectory, uloc_getISO3Language */ -void TestDataDirectory() +static void TestDataDirectory() { char oldDirectory[80]; @@ -405,7 +407,7 @@ void TestDataDirectory() /*=========================================================== */ -void doTestDisplayNames(const char* inLocale, +static void doTestDisplayNames(const char* inLocale, int32_t compareIndex, int32_t defaultIsFrench) { @@ -614,8 +616,9 @@ void doTestDisplayNames(const char* inLocale, } free(testLocale); } + /* test for uloc_getISOLanguages, uloc_getISOCountries */ -void TestISOFunctions() +static void TestISOFunctions() { @@ -669,7 +672,7 @@ static UChar greekDisplayName[] = { 0x03b5, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03 0x03ac, 0x20, 0x28, 0x0395, 0x03bb, 0x03bb, 0x03ac, 0x03b4, 0x03b1, 0x29, 0 }; -void setUpDataTable() +static void setUpDataTable() { int32_t i,j; dataTable = (UChar***)(calloc(sizeof(UChar**),23)); @@ -688,10 +691,11 @@ void setUpDataTable() u_strncpy(dataTable[DNAME_EL][GREEKS],greekDisplayName,17); } + /** * @bug 4011756 4011380 */ -void TestISO3Fallback() +static void TestISO3Fallback() { const char* test="xx_YY"; @@ -713,7 +717,7 @@ void TestISO3Fallback() /** * @bug 4118587 */ -void TestSimpleDisplayNames() +static void TestSimpleDisplayNames() { /* This test is different from TestDisplayNames because TestDisplayNames checks @@ -751,7 +755,7 @@ void TestSimpleDisplayNames() /** * @bug 4118595 */ -void TestUninstalledISO3Names() +static void TestUninstalledISO3Names() { /* This test checks to make sure getISO3Language and getISO3Country work right even for locales that are not installed. */ @@ -784,7 +788,7 @@ void TestUninstalledISO3Names() } -void TestVariantParsing() +static void TestVariantParsing() { const char* en_US_custom="en_US_De Anza_Cupertino_California_United States_Earth"; const char* dispName="English (United States, DE ANZA_CUPERTINO_CALIFORNIA_UNITED STATES_EARTH)"; diff --git a/icu4c/source/test/cintltst/cmsgtst.c b/icu4c/source/test/cintltst/cmsgtst.c index e162f185515..7695de293e3 100644 --- a/icu4c/source/test/cintltst/cmsgtst.c +++ b/icu4c/source/test/cintltst/cmsgtst.c @@ -65,8 +65,9 @@ static void InitStrings( void ) u_uastrcpy(testResultStrings[i], txt_testResultStrings[i] ); } } + /* Test u_formatMessage() with various test patterns() */ -void MessageFormatTest( void ) +static void MessageFormatTest( void ) { UChar *str; @@ -110,7 +111,7 @@ void MessageFormatTest( void ) /*test u_formatMessage() with sample patterns */ -void TestSampleMessageFormat() +static void TestSampleMessageFormat() { UChar *str; UChar *result; @@ -204,10 +205,10 @@ void TestSampleMessageFormat() free(str); - } + /* Test u_formatMessage() and u_parseMessage() , format and parse sequence and round trip */ -void TestSampleFormatAndParse() +static void TestSampleFormatAndParse() { UChar *result, *tzID, *str; @@ -294,8 +295,9 @@ void TestSampleFormatAndParse() free(tzID); } + /* test message format with a choice option */ -void TestMsgFormatChoice() +static void TestMsgFormatChoice() { UChar* str; UErrorCode status = U_ZERO_ERROR; @@ -380,8 +382,9 @@ void TestMsgFormatChoice() free(str); } + /*test u_parseMessage() with various test patterns */ -void TestParseMessage() +static void TestParseMessage() { UChar pattern[100]; UChar source[100]; @@ -426,7 +429,7 @@ void TestParseMessage() } -int32_t CallFormatMessage(const char* locale, UChar* testCasePattern, int32_t patternLength, +static int32_t CallFormatMessage(const char* locale, UChar* testCasePattern, int32_t patternLength, UChar* result, int32_t resultLength, UErrorCode *status, ...) { int32_t len = 0; @@ -438,7 +441,7 @@ int32_t CallFormatMessage(const char* locale, UChar* testCasePattern, int32_t pa } /* Test u_vformatMessage() with various test patterns. */ -void TestMessageFormatWithValist( void ) +static void TestMessageFormatWithValist( void ) { UChar *str; @@ -480,7 +483,7 @@ void TestMessageFormatWithValist( void ) free(str); } -void CallParseMessage(const char* locale, UChar* pattern, int32_t patternLength, +static void CallParseMessage(const char* locale, UChar* pattern, int32_t patternLength, UChar* source, int32_t sourceLength, UErrorCode *status, ...) { va_list ap; @@ -488,8 +491,9 @@ void CallParseMessage(const char* locale, UChar* pattern, int32_t patternLength, u_vparseMessage(locale, pattern, patternLength, source, sourceLength, ap, status); va_end(ap); } + /*test u_vparseMessage() with various test patterns */ -void TestParseMessageWithValist() +static void TestParseMessageWithValist() { UChar pattern[100]; UChar source[100]; @@ -530,6 +534,7 @@ void TestParseMessageWithValist() else log_err("FAIL: Error in parseMessage on test#10 \n"); } + void addMsgForTest(TestNode** root) { addTest(root, &MessageFormatTest, "tsformat/cmsgtst/MessageFormatTest"); diff --git a/icu4c/source/test/cintltst/cnmdptst.c b/icu4c/source/test/cintltst/cnmdptst.c index 182c081afb1..0a7ac1090ed 100644 --- a/icu4c/source/test/cintltst/cnmdptst.c +++ b/icu4c/source/test/cintltst/cnmdptst.c @@ -41,8 +41,9 @@ void addNumFrDepTest(TestNode** root) addTest(root, &TestSecondaryGrouping, "tsformat/cnmdptst/TestSecondaryGrouping"); } + /*Test Various format patterns*/ -void TestPatterns(void) +static void TestPatterns(void) { int32_t pat_length, i, lneed; UNumberFormat *fmt; @@ -103,8 +104,9 @@ void TestPatterns(void) unum_close(fmt); } } + /* Test the handling of quotes*/ -void TestQuotes(void) +static void TestQuotes(void) { int32_t lneed; UErrorCode status; @@ -170,7 +172,7 @@ void TestQuotes(void) } /* Test exponential pattern*/ -void TestExponential(void) +static void TestExponential(void) { int32_t pat_length, val_length, lval_length; int32_t ival, ilval, p, v, lneed; @@ -319,7 +321,7 @@ void TestExponential(void) /** * Test the handling of the currency symbol in patterns. */ -void TestCurrencySign(void) +static void TestCurrencySign(void) { int32_t lneed; UNumberFormat *fmt; @@ -382,10 +384,11 @@ void TestCurrencySign(void) unum_close(fmt); free(pattern); } + /** * Test localized currency patterns. */ -void TestCurrency(void) +static void TestCurrency(void) { UNumberFormat *currencyFmt; UChar *str=NULL, *res=NULL; @@ -423,7 +426,7 @@ void TestCurrency(void) /** * Test proper rounding by the format method. */ -void TestRounding487(void) +static void TestRounding487(void) { UNumberFormat *nnf; UErrorCode status = U_ZERO_ERROR; @@ -446,7 +449,7 @@ void TestRounding487(void) /*-------------------------------------*/ -void roundingTest(UNumberFormat* nf, double x, int32_t maxFractionDigits, const char* expected) +static void roundingTest(UNumberFormat* nf, double x, int32_t maxFractionDigits, const char* expected) { UChar *out = NULL; UChar *res; @@ -475,10 +478,11 @@ void roundingTest(UNumberFormat* nf, double x, int32_t maxFractionDigits, const free(out); } } + /* * Testing unum_getDoubleAttribute and unum_setDoubleAttribute() */ -void TestDoubleAttribute(void) +static void TestDoubleAttribute(void) { double mydata[] = { 1.11, 22.22, 333.33, 4444.44, 55555.55, 666666.66, 7777777.77, 88888888.88, 999999999.99}; double dvalue; @@ -506,7 +510,7 @@ void TestDoubleAttribute(void) /** * Test the functioning of the secondary grouping value. */ -void TestSecondaryGrouping(void) { +static void TestSecondaryGrouping(void) { UErrorCode status = U_ZERO_ERROR; UNumberFormat *f = NULL, *g= NULL; UNumberFormat *us = unum_open(UNUM_DECIMAL, "en_US", &status); diff --git a/icu4c/source/test/cintltst/cnormtst.c b/icu4c/source/test/cintltst/cnormtst.c index 062f30a4b28..10a6f6f5f9a 100644 --- a/icu4c/source/test/cintltst/cnormtst.c +++ b/icu4c/source/test/cintltst/cnormtst.c @@ -223,7 +223,7 @@ void TestCompatDecompCompose() -void assertEqual(const UChar* result, const UChar* expected, int32_t index) +static void assertEqual(const UChar* result, const UChar* expected, int32_t index) { if(u_strcmp(result, expected)!=0){ log_err("ERROR in decomposition at index = %d. EXPECTED: %s , GOT: %s\n", index, austrdup(expected), @@ -231,7 +231,7 @@ void assertEqual(const UChar* result, const UChar* expected, int32_t index) } } -void TestNull_check(UChar *src, int32_t srcLen, +static void TestNull_check(UChar *src, int32_t srcLen, UChar *exp, int32_t expLen, UNormalizationMode mode, const char *name) diff --git a/icu4c/source/test/cintltst/cregrtst.c b/icu4c/source/test/cintltst/cregrtst.c index 9b7317328b2..2dc56f1bdd0 100644 --- a/icu4c/source/test/cintltst/cregrtst.c +++ b/icu4c/source/test/cintltst/cregrtst.c @@ -1119,7 +1119,7 @@ AllocateTextBoundary(); c == 0xfeff) continue; work[2] = c; - ubrk_setText(e, work, u_strlen(work), &status); + ubrk_setText(e, work, u_strlen(work), &status); if(U_FAILURE(status)){ log_err("FAIL: Error in setting text on the word break Iterator in testLineInvaiants:\n %s \n", myErrorName(status)); return; diff --git a/icu4c/source/test/cintltst/creststn.c b/icu4c/source/test/cintltst/creststn.c index 86d5af07be7..ac379520c47 100644 --- a/icu4c/source/test/cintltst/creststn.c +++ b/icu4c/source/test/cintltst/creststn.c @@ -174,7 +174,7 @@ void addNEWResourceBundleTest(TestNode** root) /***************************************************************************************/ -void TestAliasConflict(void) { +static void TestAliasConflict(void) { UErrorCode status = U_ZERO_ERROR; UResourceBundle *he = NULL; UResourceBundle *iw = NULL; @@ -193,7 +193,7 @@ void TestAliasConflict(void) { ures_close(he); } -void TestNewTypes() { +static void TestNewTypes() { UResourceBundle* theBundle = NULL; char action[256]; char testdatapath[256]; @@ -265,7 +265,7 @@ void TestNewTypes() { } -void TestBinaryCollationData(){ +static void TestBinaryCollationData(){ UErrorCode status=U_ZERO_ERROR; const char* directory=NULL; const char* locale="te"; @@ -316,7 +316,8 @@ void TestBinaryCollationData(){ ures_close(teRes); } -void TestAPI(){ + +static void TestAPI() { UErrorCode status=U_ZERO_ERROR; const char* directory=NULL; int32_t len=0; @@ -409,7 +410,8 @@ void TestAPI(){ } -void TestErrorConditions(){ + +static void TestErrorConditions(){ UErrorCode status; const char* directory=NULL; const char *key=NULL; @@ -618,7 +620,7 @@ void TestErrorConditions(){ } -void TestResourceBundles() +static void TestResourceBundles() { testTag("only_in_Root", TRUE, FALSE, FALSE); @@ -635,7 +637,7 @@ void TestResourceBundles() } -void TestConstruction1() +static void TestConstruction1() { UResourceBundle *test1 = 0, *test2 = 0; const UChar *result1, *result2; @@ -701,7 +703,7 @@ void TestConstruction1() ures_close(test2); } -void TestConstruction2() +static void TestConstruction2() { UChar temp[7]; @@ -757,7 +759,7 @@ void TestConstruction2() /*****************************************************************************/ /*****************************************************************************/ -UBool testTag(const char* frag, +static UBool testTag(const char* frag, UBool in_Root, UBool in_te, UBool in_te_IN) @@ -1176,12 +1178,12 @@ UBool testTag(const char* frag, return pass; } -void record_pass() +static void record_pass() { ++pass; } -void record_fail() +static void record_fail() { ++fail; } @@ -1191,7 +1193,7 @@ void record_fail() * are set correctly */ -void TestFallback() +static void TestFallback() { UErrorCode status = U_ZERO_ERROR; UResourceBundle *fr_FR = NULL; @@ -1239,7 +1241,7 @@ void TestFallback() ures_close(fr_FR); } -void printUChars(UChar* uchars){ +static void printUChars(UChar* uchars){ int16_t i=0; for(i=0; iu with substitute with value did not match.\n"); } } -void TestLegalAndOthers(int32_t inputsize, int32_t outputsize) + +static void TestLegalAndOthers(int32_t inputsize, int32_t outputsize) { UChar legalText[] = { 0x0000, 0xAC00, 0xAC01, 0xD700 }; const uint8_t templegal949[] ={ 0x00, 0xb0, 0xa1, 0xb0, 0xa2, 0xc8, 0xd3 }; @@ -1249,7 +1261,8 @@ void TestLegalAndOthers(int32_t inputsize, int32_t outputsize) log_err("ibm-943->u with stop did not match.\n"); } -void TestSingleByte(int32_t inputsize, int32_t outputsize) + +static void TestSingleByte(int32_t inputsize, int32_t outputsize) { const uint8_t sampleText[] = { 0x82, 0xa9, 0x61, 0x62, 0x63 , 0x82, @@ -1265,7 +1278,8 @@ void TestSingleByte(int32_t inputsize, int32_t outputsize) (UConverterToUCallback)UCNV_TO_U_CALLBACK_SUBSTITUTE, fromIBM943Offssub, NULL, 0 )) log_err("ibm-943->u with subst did not match.\n"); } -void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize) + +static void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize) { /*EBCDIC_STATEFUL*/ UChar ebcdic_inputTest[] = { 0x0061, 0x6d64, 0x0061, 0x00A2, 0x6d65 }; diff --git a/icu4c/source/test/cintltst/nccbtst.h b/icu4c/source/test/cintltst/nccbtst.h index 1f00f533841..52c0f145c3c 100644 --- a/icu4c/source/test/cintltst/nccbtst.h +++ b/icu4c/source/test/cintltst/nccbtst.h @@ -40,12 +40,12 @@ static void TestSingleByte(int32_t inputsize, int32_t outputsize); static void TestEBCDIC_STATEFUL_Sub(int32_t inputsize, int32_t outputsize); UBool testConvertFromUnicode(const UChar *source, int sourceLen, const uint8_t *expect, int expectLen, - const char *codepage, UConverterFromUCallback callback, const int32_t *expectOffsets, + const char *codepage, UConverterFromUCallback callback, const int32_t *expectOffsets, const char *mySubChar, int8_t len); UBool testConvertToUnicode( const uint8_t *source, int sourcelen, const UChar *expect, int expectlen, - const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets, + const char *codepage, UConverterToUCallback callback, const int32_t *expectOffsets, const char *mySubChar, int8_t len); diff --git a/icu4c/source/test/cintltst/ncnvfbts.c b/icu4c/source/test/cintltst/ncnvfbts.c index ff18cd987dc..7472010576f 100644 --- a/icu4c/source/test/cintltst/ncnvfbts.c +++ b/icu4c/source/test/cintltst/ncnvfbts.c @@ -33,36 +33,43 @@ static int32_t gInBufferSize = 0; static int32_t gOutBufferSize = 0; static char gNuConvTestName[1024]; -void printSeq(const unsigned char* a, int len) +static void printSeq(const unsigned char* a, int len) { int i=0; log_verbose("{"); - while (ix|y * 2. yc>z @@ -275,7 +275,7 @@ void TestSimpleRules() { "abcdefgABCDEFGU", "&bcd&fg!^**!^*&"); } -void TestFilter() { +static void TestFilter() { UErrorCode status = U_ZERO_ERROR; UChar filt[128]; UChar buf[128]; @@ -339,7 +339,7 @@ void TestFilter() { utrans_close(hex); } -void _expectRules(const char* crules, +static void _expectRules(const char* crules, const char* cfrom, const char* cto) { /* u_uastrcpy has no capacity param for the buffer -- so just @@ -366,7 +366,7 @@ void _expectRules(const char* crules, utrans_close(trans); } -void _expect(const UTransliterator* trans, +static void _expect(const UTransliterator* trans, const char* cfrom, const char* cto) { /* u_uastrcpy has no capacity param for the buffer -- so just