提交 1c2998c7 编写于 作者: C cheng_jinsong

add ut nullptr check

Signed-off-by: Ncheng_jinsong <chengjinsong2@huawei.com>
Change-Id: Ibc73bd85c4c1a6f7bb289e108ad832d4a62bb9f9
上级 be6255b2
......@@ -172,7 +172,9 @@ HWTEST_F(DeviceInfoUnittest, TestInterface, TestSize.Level1)
HWTEST_F(DeviceInfoUnittest, TestDeviceInfoProxy1, TestSize.Level1)
{
auto remote = device_info::DeviceInfoKits::GetInstance().GetService()->AsObject();
auto remotePtr = device_info::DeviceInfoKits::GetInstance().GetService();
ASSERT_NE(remotePtr, nullptr);
auto remote = remotePtr->AsObject();
sptr<device_info::DeviceInfoProxy> proxy = new(std::nothrow) device_info::DeviceInfoProxy(remote);
ASSERT_NE(proxy, nullptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册