提交 ec3a5f8d 编写于 作者: Z zhangboyuan

ipc用例新增与修复

Signed-off-by: Nzhangboyuan <zhangboyuan1@huawei.com>
上级 a99f6f33
......@@ -354,36 +354,6 @@ HWTEST_F(IPCDbinderDataBusInvokerTest, AuthSession2Proxy003, TestSize.Level1)
EXPECT_FALSE(res);
}
/**
* @tc.name: AuthSession2Proxy004
* @tc.desc: AuthSession2Proxy
* @tc.type: FUNC
*/
HWTEST_F(IPCDbinderDataBusInvokerTest, AuthSession2Proxy004, TestSize.Level1)
{
uint32_t handle = 0;
IPCObjectProxy *ipcProxy = new IPCObjectProxy(handle, u"testproxy");
std::shared_ptr<MockSessionImpl> session = std::make_shared<MockSessionImpl>();
std::shared_ptr<DBinderSessionObject> databusSession =
std::make_shared<DBinderSessionObject>(session, SERVICE_NAME_TEST, DEVICE_ID_TEST, 1, ipcProxy, 1);
DBinderDatabusInvoker testInvoker;
EXPECT_CALL(*session, GetPeerPid())
.WillRepeatedly(testing::Return(1));
EXPECT_CALL(*session, GetPeerUid())
.WillRepeatedly(testing::Return(1));
EXPECT_CALL(*session, GetPeerDeviceId())
.WillRepeatedly(testing::ReturnRef("test"));
bool res = testInvoker.AuthSession2Proxy(handle, databusSession);
EXPECT_FALSE(res);
databusSession->proxy_ = nullptr;
delete ipcProxy;
}
/**
* @tc.name: QuerySessionOfBinderProxy001
* @tc.desc: QuerySessionOfBinderProxy
......
......@@ -59,3 +59,28 @@ HWTEST_F(IRemoteObjectTest, CheckObjectLegalityTest001, TestSize.Level1)
auto ret = object.CheckObjectLegality();
ASSERT_FALSE(ret);
}
/**
* @tc.name: IsObjectDeadTest001
* @tc.desc: Verify the IRemoteObject::IsObjectDead function
* @tc.type: FUNC
*/
HWTEST_F(IRemoteObjectTest, IsObjectDeadTest001, TestSize.Level1)
{
IPCObjectProxy object(1);
auto ret = object.IsObjectDead();
ASSERT_FALSE(ret);
}
/**
* @tc.name: GetInterfaceDescriptorTest001
* @tc.desc: Verify the IRemoteObject::GetInterfaceDescriptor function
* @tc.type: FUNC
*/
HWTEST_F(IRemoteObjectTest, GetInterfaceDescriptorTest001, TestSize.Level1)
{
IPCObjectProxy object(1);
EXPECT_NE(object.descriptor_ , object.GetInterfaceDescriptor());
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册