From 5c982f1087f95174f2836c72648eab58adf37fd7 Mon Sep 17 00:00:00 2001 From: LiteOS2021 Date: Tue, 22 Feb 2022 17:50:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(time=5Ffunc=5Ftest=5F01.c):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DtestTimes=E6=B5=8B=E8=AF=95=E5=8D=95=E6=9D=BF=E9=85=8D?= =?UTF-8?q?=E7=BD=AELOSCFG=5FBASE=5FCORE=5FTICK=5FPER=5FSECOND=20=3D=20100?= =?UTF-8?q?0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复testTimes测试单板配置LOSCFG_BASE_CORE_TICK_PER_SECOND = 1000的问题 Signed-off-by: LiteOS2021 --- testsuites/unittest/posix/src/time/time_func_test_01.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuites/unittest/posix/src/time/time_func_test_01.c b/testsuites/unittest/posix/src/time/time_func_test_01.c index a11a4c69..474d4f04 100644 --- a/testsuites/unittest/posix/src/time/time_func_test_01.c +++ b/testsuites/unittest/posix/src/time/time_func_test_01.c @@ -516,8 +516,8 @@ LITE_TEST_CASE(PosixTimeFuncTestSuite, testTimeStrftime003, Function | MediumTes */ LITE_TEST_CASE(PosixTimeFuncTestSuite, testTimes, Function | MediumTest | Level1) { - const int testClockt = 100; - const int msPerClock = 10; + const int testClockt = LOSCFG_BASE_CORE_TICK_PER_SECOND; + const int msPerClock = OS_SYS_MS_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND; struct tms start = { 0 }; struct tms end = { 0 }; clock_t stTime = times(&start); @@ -562,6 +562,6 @@ void PosixTimeFuncTest() RUN_ONE_TESTCASE(testTimeStrftime001); RUN_ONE_TESTCASE(testTimeStrftime002); RUN_ONE_TESTCASE(testTimeStrftime003); - + RUN_ONE_TESTCASE(testTimes); return; }