fix: UT testcase issues

Signed-off-by: wenkaisong <songwenkai1@huawei.com>
This commit is contained in:
wenkaisong 2023-05-23 22:08:08 +08:00
parent 1b06e4e2b7
commit 1cb58a3825
2 changed files with 9 additions and 5 deletions

View File

@ -31,7 +31,7 @@ static int DslmIpcCallback(IOwner owner, int code, IpcIo *reply)
return ERR_INVALID_PARA;
}
uint32_t cookie, result, level;
uint32_t result, level;
struct DslmCallbackHolder *holder = (struct DslmCallbackHolder *)owner;
ReadUint32(reply, &result);

View File

@ -1519,12 +1519,16 @@ HWTEST_F(DslmTest, DestroyDslmCred_case1, TestSize.Level0)
*/
HWTEST_F(DslmTest, ReportHiEventAppInvoke_case1, TestSize.Level0)
{
DslmDeviceInfo info;
(void)memset_s(&info, sizeof(DslmDeviceInfo), 0, sizeof(DslmDeviceInfo));
info.lastRequestTime = 10U;
DslmDeviceInfo *info = (DslmDeviceInfo *)MALLOC(sizeof(DslmDeviceInfo));
ASSERT_NE(nullptr, info);
(void)memset_s(info, sizeof(DslmDeviceInfo), 0, sizeof(DslmDeviceInfo));
info->lastRequestTime = 10U;
ReportHiEventInfoSync(nullptr);
ReportHiEventInfoSync(&info);
ReportHiEventInfoSync(info);
ReportHiEventAppInvoke(nullptr);
EXPECT_NE(nullptr, info);
FREE(info);
info = nullptr;
}
/**