!985 fix: mktime测试用例配套修改

Merge pull request !985 from Zhaotianyu/20230103fix_mktime_test
This commit is contained in:
openharmony_ci 2023-01-03 07:45:12 +00:00 committed by Gitee
commit ddf3dc8237
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 2 deletions

View File

@ -377,12 +377,12 @@ LITE_TEST_CASE(PosixTimeFuncTestSuite, testTimeMktime001, Function | MediumTest
INIT_TM(timeptr, 2020, 7, 9, 18, 10, 0, 7); INIT_TM(timeptr, 2020, 7, 9, 18, 10, 0, 7);
time_t timeRet = mktime(&timeptr); time_t timeRet = mktime(&timeptr);
LOG("\n 2020-7-9 18:10:00, mktime Ret = %lld", timeRet); LOG("\n 2020-7-9 18:10:00, mktime Ret = %lld", timeRet);
TEST_ASSERT_EQUAL_INT(1596996600, timeRet); TEST_ASSERT_EQUAL_INT(1596967800, timeRet);
INIT_TM(timeptr, 1970, 0, 1, 8, 0, 0, 0); INIT_TM(timeptr, 1970, 0, 1, 8, 0, 0, 0);
timeRet = mktime(&timeptr); timeRet = mktime(&timeptr);
LOG("\n 1970-1-1 08:00:00, mktime Ret = %lld", timeRet); LOG("\n 1970-1-1 08:00:00, mktime Ret = %lld", timeRet);
TEST_ASSERT_EQUAL_INT(28800, timeRet); TEST_ASSERT_EQUAL_INT(0, timeRet);
struct tm *stm = localtime(&testTime); struct tm *stm = localtime(&testTime);
LOG("\n testTime 18880, tm : %s", TmToStr(stm, timeStr, TIME_STR_LEN)); LOG("\n testTime 18880, tm : %s", TmToStr(stm, timeStr, TIME_STR_LEN));