From f7e3c1801464efb14b49675a77fbcacff905eae2 Mon Sep 17 00:00:00 2001 From: Ywenrui44091 Date: Fri, 12 Jan 2024 11:28:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ywenrui44091 --- test/unittest/rtg/rtg_test.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/unittest/rtg/rtg_test.cpp b/test/unittest/rtg/rtg_test.cpp index cb5390f..a2c5464 100644 --- a/test/unittest/rtg/rtg_test.cpp +++ b/test/unittest/rtg/rtg_test.cpp @@ -123,8 +123,8 @@ enum RtgType : int { static int BasicOpenRtgNode() { char fileName[] = "/proc/self/sched_rtg_ctrl"; - int fd = open(fileName, O_RDWR); + int fd = open(fileName, O_RDWR); if (fd < 0) { cout << "open node err." << endl; } @@ -250,7 +250,7 @@ static int EndScene(int grpId) int fd = BasicOpenRtgNode(); if (fd < 0) { - return fd; + return fd; } ret = ioctl(fd, CMD_ID_END_SCENE, &stateData); @@ -297,8 +297,8 @@ static int AddThreadsToRtg(vector tids, int grpId, int prioType) { struct RtgGrpData grpData; int ret; - int fd = BasicOpenRtgNode(); + int fd = BasicOpenRtgNode(); if (fd < 0) { return fd; } @@ -323,13 +323,15 @@ static int AddThreadsToRtg(vector tids, int grpId, int prioType) return ret; } -void RtgTest::SetUp() { +void RtgTest::SetUp() +{ // must enable rtg before use the interface int ret = EnableRtg(true); ASSERT_EQ(RTG_SUCC, ret); } -void RtgTest::TearDown() { +void RtgTest::TearDown() +{ // disable rtg after use the interface int ret = EnableRtg(false); ASSERT_EQ(RTG_SUCC, ret); @@ -673,7 +675,7 @@ HWTEST_F(RtgTest, RtgAddMutipleThreadsSucc, Function | MediumTest | Level1) ASSERT_TRUE(pid[i] >= 0) << "> parent: fork errno = " << errno; if (pid[i] == 0) { usleep(50000); - _Exit(0); + _Exit(0); } threads.push_back(pid[i]); } -- Gitee