!1927 FIX:修改UT无断言问题

Merge pull request !1927 from cheng_jinsong/0428_ut
This commit is contained in:
openharmony_ci 2023-05-05 08:20:12 +00:00 committed by Gitee
commit 97d2280067
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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;
}