提交 64747f48 编写于 作者: W wanderer-dl122

update ut

Signed-off-by: Nwanderer-dl122 <dengliang21@huawei.com>
上级 5a44c394
......@@ -285,6 +285,29 @@ HWTEST_F(IPCDbinderDataBusInvokerTest, NewSessionOfBinderProxy002, TestSize.Leve
EXPECT_TRUE (remoteSession != nullptr);
}
/**
* @tc.name: NewSessionOfBinderProxy003
* @tc.desc: NewSessionOfBinderProxy
* @tc.type: FUNC
*/
HWTEST_F(IPCDbinderDataBusInvokerTest, NewSessionOfBinderProxy003, TestSize.Level1)
{
uint32_t handle = REGISTRY_HANDLE;
std::shared_ptr<DBinderSessionObject> remoteSession =
std::make_shared<DBinderSessionObject>(nullptr, SERVICE_NAME_TEST, DEVICE_ID_TEST, 1, nullptr, 1);
EXPECT_TRUE (remoteSession != nullptr);
IPCThreadSkeleton *current = IPCThreadSkeleton::GetCurrent();
current->invokers_[IRemoteObject::IF_PROT_DEFAULT] = nullptr;
IRemoteInvoker *invoker = IPCThreadSkeleton::GetRemoteInvoker(IRemoteObject::IF_PROT_DEFAULT);
ASSERT_TRUE(invoker == nullptr);
DBinderDatabusInvoker testInvoker;
std::shared_ptr<DBinderSessionObject> ret = testInvoker.NewSessionOfBinderProxy(handle, remoteSession);
EXPECT_TRUE (ret == nullptr);
current->invokers_.clear();
}
/**
* @tc.name: AuthSession2Proxy001
* @tc.desc: AuthSession2Proxy
......
......@@ -143,6 +143,19 @@ HWTEST_F(IPCObjectProxyTest, GetSessionNameForPidUidTest001, TestSize.Level1)
ASSERT_TRUE(ret.size() == 0);
}
/**
* @tc.name: GetPidUidTest001
* @tc.desc: Verify the IPCObjectProxy::GetPidUid function
* @tc.type: FUNC
*/
HWTEST_F(IPCObjectProxyTest, GetPidUidTest001, TestSize.Level1)
{
IPCObjectProxy object(1);
MessageParcel reply;
auto ret = object.GetPidUid(reply);
ASSERT_TRUE(ret == 0);
}
/**
* @tc.name: GetInterfaceDescriptorTest001
* @tc.desc: Verify the IPCObjectProxy::GetInterfaceDescriptor function
......
......@@ -1009,4 +1009,30 @@ HWTEST_F(IPCObjectStubTest, CreateSessionNameTest002, TestSize.Level1)
auto ret = testStub->CreateSessionName(uid, pid);
ASSERT_TRUE(ret.size() == 0);
}
#endif
\ No newline at end of file
#endif
/**
* @tc.name: GetCallingTokenIDTest001
* @tc.desc: Verify the GetCallingTokenID function
* @tc.type: FUNC
*/
HWTEST_F(IPCObjectStubTest, GetCallingTokenIDTest001, TestSize.Level1)
{
sptr<IPCObjectStub> testStub = new IPCObjectStub(u"testStub");
auto ret = testStub->GetCallingTokenID();
EXPECT_EQ(ret, 0);
}
/**
* @tc.name: GetCallingFullTokenIDTest001
* @tc.desc: Verify the GetCallingFullTokenID function
* @tc.type: FUNC
*/
HWTEST_F(IPCObjectStubTest, GetCallingFullTokenIDTest001, TestSize.Level1)
{
sptr<IPCObjectStub> testStub = new IPCObjectStub(u"testStub");
auto ret = testStub->GetCallingFullTokenID();
EXPECT_EQ(ret, 0);
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册