From 59329ce7c6b6a00084df427748e6283287a773c0 Mon Sep 17 00:00:00 2001 From: yinjiaming Date: Thu, 17 Feb 2022 07:30:15 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DA=E6=A0=B8=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E3=80=90=E8=83=8C=E6=99=AF=E3=80=91=20=E3=80=90Ope?= =?UTF-8?q?nHarmony=E3=80=91=E3=80=90master=E3=80=91L1=20liteos=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=89=A7=E8=A1=8Cliteos=5Fa=5Flibc=5Funittest.bin=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=A5=97TimeTimerTest=203=E6=9D=A1=E7=94=A8=E4=BE=8BFail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【修改方案】 将一个测试用例中创建的无限循环的线程 在测试用例末尾关闭 【影响】 对现有的产品编译不会有影响。 re #I4SQDR Signed-off-by: yinjiaming Change-Id: I390f411502fe1a6a04071e0d7e02d936e3388cd7 --- testsuites/unittest/libc/time/clock/full/clock_test_002.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp b/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp index de50492f..f951d878 100644 --- a/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp +++ b/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp @@ -34,6 +34,7 @@ static void *ThreadFuncTest(void *arg) { printf("Subthread starting infinite loop\n"); while (1) { + pthread_testcancel(); } } @@ -80,6 +81,9 @@ static int ClockTest(void) ret = ThreadClock("Subthread CPU time: ", clockid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); + ret = pthread_cancel(thread); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); + return 0; } -- GitLab