diff --git a/test/unittest/init/init_unittest.cpp b/test/unittest/init/init_unittest.cpp index d1181bb698747d97ebffbbbc018ba39d138c064e..0e0026af4d2c3303141146b30a196cbedc7afde4 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 19f4dfe9581d14f3119da5b9d34b3704e0952784..a20b46cfef7d59920006716e161978f77d4f77c5 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; }