diff --git a/icu4c/source/test/cintltst/ccaltst.c b/icu4c/source/test/cintltst/ccaltst.c index 0c67b1c0916..f9771c0a130 100644 --- a/icu4c/source/test/cintltst/ccaltst.c +++ b/icu4c/source/test/cintltst/ccaltst.c @@ -415,7 +415,8 @@ static void TestGetSetDateAPI() - + ctest_setTimeZone(NULL, &status); + /*testing ucal_setTimeZone() function*/ log_verbose("\nTesting if the function ucal_setTimeZone() works fine\n"); ucal_setMillis(caldef2, d2, &status); @@ -474,6 +475,9 @@ static void TestGetSetDateAPI() else if (zoneOffset != -28800000) { log_err("Error in getting the time zone using ucal_get() after using ucal_setTimeZone() offset=%d\n", zoneOffset); } + + ctest_resetTimeZone(); + /*----------------------------* */ diff --git a/icu4c/source/test/cintltst/cdattst.c b/icu4c/source/test/cintltst/cdattst.c index 68ec5ab0c0f..f279434e9d2 100644 --- a/icu4c/source/test/cintltst/cdattst.c +++ b/icu4c/source/test/cintltst/cdattst.c @@ -60,6 +60,9 @@ static void TestDateFormat() /*const char* str="yyyy.MM.dd G 'at' hh:mm:ss z"; const char t[]="2/3/76 2:50 AM";*/ /*Testing udat_open() to open a dateformat */ + + ctest_setTimeZone(NULL, &status); + log_verbose("\nTesting udat_open() with various parameters\n"); fr = udat_open(UDAT_FULL, UDAT_DEFAULT, "fr_FR", NULL,0, NULL, 0,&status); if(U_FAILURE(status)) @@ -325,6 +328,7 @@ static void TestDateFormat() udat_close(fr_pat); udat_close(copy); + ctest_resetTimeZone(); } /*Testing udat_getSymbols() and udat_setSymbols() and udat_countSymbols()*/ @@ -558,6 +562,8 @@ static void TestDateFormatCalendar() { UDate when; UErrorCode ec = U_ZERO_ERROR; + ctest_setTimeZone(NULL, &ec); + /* Create a formatter for date fields. */ date = udat_open(UDAT_NONE, UDAT_SHORT, "en_US", NULL, 0, NULL, 0, &ec); if (U_FAILURE(ec)) { @@ -627,7 +633,7 @@ static void TestDateFormatCalendar() { if (when == 986517900000.0) { log_verbose("Ok: Parsed result: %s\n", cbuf); } else { - log_err("FAIL: Parsed result: %s, exp 4/5/2001 5:45 PM", cbuf); + log_err("FAIL: Parsed result: %s, exp 4/5/2001 5:45 PM\n", cbuf); } FAIL: @@ -635,6 +641,8 @@ static void TestDateFormatCalendar() { udat_close(time); udat_close(full); ucal_close(cal); + + ctest_resetTimeZone(); } /*INTERNAL FUNCTIONS USED*/ diff --git a/icu4c/source/test/cintltst/cdtdptst.c b/icu4c/source/test/cintltst/cdtdptst.c index 2c9c6b770db..8fabc263eb5 100644 --- a/icu4c/source/test/cintltst/cdtdptst.c +++ b/icu4c/source/test/cintltst/cdtdptst.c @@ -53,6 +53,8 @@ void TestTwoDigitYearDSTParse() UChar *s; int32_t pos; + ctest_setTimeZone(NULL, &status); + pattern=(UChar*)malloc(sizeof(UChar) * (strlen("EEE MMM dd HH:mm:ss.SSS zzz yyyy G")+1 )); u_uastrcpy(pattern, "EEE MMM dd HH:mm:ss.SSS zzz yyyy G"); fullFmt= udat_open(UDAT_IGNORE, UDAT_IGNORE,"en_US",NULL,0,pattern, u_strlen(pattern),&status); @@ -94,6 +96,8 @@ void TestTwoDigitYearDSTParse() udat_close(fmt); free(pattern); free(s); + + ctest_resetTimeZone(); } @@ -292,6 +296,9 @@ void TestQuotePattern161() UChar *dateString; UErrorCode status = U_ZERO_ERROR; const char* expStr = "04/13/1999 at 10:42:28 AM "; + + ctest_setTimeZone(NULL, &status); + pattern=(UChar*)malloc(sizeof(UChar) * (strlen("MM/dd/yyyy 'at' hh:mm:ss a zzz")+1) ); u_uastrcpy(pattern, "MM/dd/yyyy 'at' hh:mm:ss a zzz"); @@ -328,6 +335,7 @@ void TestQuotePattern161() free(tzID); free(pattern); + ctest_resetTimeZone(); } #endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/icu4c/source/test/cintltst/cdtrgtst.c b/icu4c/source/test/cintltst/cdtrgtst.c index 55e44e5ab4a..ef544fcaf26 100644 --- a/icu4c/source/test/cintltst/cdtrgtst.c +++ b/icu4c/source/test/cintltst/cdtrgtst.c @@ -474,6 +474,8 @@ void Test714(void) UChar *result; const char* expect = "7:25:43 AM"; + ctest_setTimeZone(NULL, &status); + fmt= udat_open(UDAT_MEDIUM,UDAT_NONE ,"en_US_CA", NULL, -1, NULL, 0, &status); if(U_FAILURE(status)) { @@ -495,6 +497,8 @@ void Test714(void) } udat_close(fmt); + + ctest_resetTimeZone(); } /*INTERNAL FUNCTION USED */ diff --git a/icu4c/source/test/cintltst/cmsgtst.c b/icu4c/source/test/cintltst/cmsgtst.c index 8e2329621ff..e89cddcae74 100644 --- a/icu4c/source/test/cintltst/cmsgtst.c +++ b/icu4c/source/test/cintltst/cmsgtst.c @@ -96,6 +96,9 @@ static void MessageFormatTest( void ) int32_t resultLengthOut,resultlength,i, patternlength; UErrorCode status = U_ZERO_ERROR; UDate d1=1000000000.0; + + ctest_setTimeZone(NULL, &status); + str=(UChar*)malloc(sizeof(UChar) * 7); u_uastrncpy(str, "MyDisk", 7); resultlength=1; @@ -232,6 +235,8 @@ static void MessageFormatTest( void ) umsg_close(formatter); } FreeStrings(); + + ctest_resetTimeZone(); } @@ -347,6 +352,9 @@ static void TestNewFormatAndParseAPI(void) UParseError parseError; UMessageFormat* fmt = NULL; int32_t count=0; + + ctest_setTimeZone(NULL, &status); + log_verbose("Testing format and parse with parse error\n"); str=(UChar*)malloc(sizeof(UChar) * 25); @@ -428,7 +436,8 @@ static void TestNewFormatAndParseAPI(void) free(result); free(str); free(tzID); - + + ctest_resetTimeZone(); } /* Test u_formatMessageWithError() and u_parseMessageWithError() , format and parse sequence and round trip */ @@ -448,6 +457,8 @@ static void TestSampleFormatAndParseWithError(void) UChar ret[30]; UParseError parseError; + ctest_setTimeZone(NULL, &status); + log_verbose("Testing format and parse with parse error\n"); str=(UChar*)malloc(sizeof(UChar) * 25); @@ -521,6 +532,7 @@ static void TestSampleFormatAndParseWithError(void) free(str); free(tzID); + ctest_resetTimeZone(); } /* Test u_formatMessage() and u_parseMessage() , format and parse sequence and round trip */ @@ -537,6 +549,9 @@ static void TestSampleFormatAndParse() UErrorCode status = U_ZERO_ERROR; double value = 0.0; UChar ret[30]; + + ctest_setTimeZone(NULL, &status); + log_verbose("Testing format and parse\n"); str=(UChar*)malloc(sizeof(UChar) * 25); @@ -610,6 +625,7 @@ static void TestSampleFormatAndParse() free(str); free(tzID); + ctest_resetTimeZone(); } /* test message format with a choice option */ @@ -765,6 +781,9 @@ static void TestMessageFormatWithValist( void ) int32_t resultLengthOut,resultlength,i, patternlength; UErrorCode status = U_ZERO_ERROR; UDate d1=1000000000.0; + + ctest_setTimeZone(NULL, &status); + str=(UChar*)malloc(sizeof(UChar) * 7); u_uastrcpy(str, "MyDisk"); resultlength=1; @@ -798,6 +817,8 @@ static void TestMessageFormatWithValist( void ) free(result); free(str); FreeStrings(); + + ctest_resetTimeZone(); } static void CallParseMessage(const char* locale, UChar* pattern, int32_t patternLength,