From 75edcc56f7a5818ce0e1dd1c269fd6cdfe4de33d Mon Sep 17 00:00:00 2001 From: chengjinsong2 Date: Fri, 28 Apr 2023 17:29:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9UT=E6=97=A0=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengjinsong2 --- test/unittest/init/init_unittest.cpp | 3 +++ test/unittest/param/client_unittest.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/unittest/init/init_unittest.cpp b/test/unittest/init/init_unittest.cpp index d1181bb69..0e0026af4 100644 --- a/test/unittest/init/init_unittest.cpp +++ b/test/unittest/init/init_unittest.cpp @@ -26,6 +26,7 @@ #include "init_log.h" #include "init_service.h" #include "init_unittest.h" +#include "init_adapter.h" #include "init_utils.h" #include "loop_event.h" #include "param_stub.h" @@ -83,6 +84,8 @@ HWTEST_F(InitUnitTest, TestSystemPrepare, TestSize.Level1) HWTEST_F(InitUnitTest, TestSystemExecRcs, TestSize.Level1) { SystemExecuteRcs(); + int ret = KeepCapability(); + EXPECT_EQ(ret, 0); } static void TestProcessTimer(const TimerHandle taskHandle, void *context) diff --git a/test/unittest/param/client_unittest.cpp b/test/unittest/param/client_unittest.cpp index 19f4dfe95..a20b46cfe 100644 --- a/test/unittest/param/client_unittest.cpp +++ b/test/unittest/param/client_unittest.cpp @@ -32,8 +32,6 @@ static void ClientCheckParamValue(const char *name, const char *expectValue) if (expectValue != nullptr) { EXPECT_EQ(strcmp(tmp, expectValue), 0); } - } else { - EXPECT_NE(0, 0); } } @@ -45,7 +43,8 @@ static void *TestSendParamSetMsg(void *args) } std::string name = (char *)args; PARAM_LOGI("TestSendParamSetMsg name :\'%s\' ", name.c_str()); - SystemSetParameter(name.c_str(), name.c_str()); + int ret = SystemSetParameter(name.c_str(), name.c_str()); + EXPECT_EQ(ret, 0); return nullptr; } @@ -57,7 +56,8 @@ static void *TestSendParamWaitMsg(void *args) std::string name = "Wati."; name = name + (char *)args; PARAM_LOGI("TestSendParamWaitMsg name :\'%s\' \n", name.c_str()); - SystemWaitParameter(name.c_str(), name.c_str(), 1); + int ret = SystemWaitParameter(name.c_str(), name.c_str(), 1); + EXPECT_GE(ret, 0); return nullptr; }