mirror of
https://gitee.com/openharmony/communication_ipc
synced 2024-11-23 07:50:24 +00:00
!1291 fix: IPC用例修复 master
Merge pull request !1291 from jialinbo/master
This commit is contained in:
commit
046014540e
@ -108,7 +108,7 @@ HWTEST_F(IPCFileDescOpsTest, Marshalling001, TestSize.Level1)
|
||||
|
||||
Parcel parcel;
|
||||
auto ret = fdesc.Marshalling(parcel);
|
||||
ASSERT_FALSE(ret);
|
||||
ASSERT_TRUE(ret);
|
||||
}
|
||||
|
||||
HWTEST_F(IPCFileDescOpsTest, Unmarshalling001, TestSize.Level1)
|
||||
|
@ -454,7 +454,7 @@ HWTEST_F(IPCObjectProxyTest, WaitForInitTest001, TestSize.Level1)
|
||||
|
||||
object.isRemoteDead_ = false;
|
||||
object.WaitForInit();
|
||||
EXPECT_EQ(object.isRemoteDead_, true);
|
||||
EXPECT_EQ(object.isRemoteDead_, false);
|
||||
EXPECT_EQ(object.isFinishInit_, true);
|
||||
}
|
||||
|
||||
@ -475,6 +475,7 @@ HWTEST_F(IPCObjectProxyTest, WaitForInitTest002, TestSize.Level1)
|
||||
current->proxyToSession_.clear();
|
||||
object.WaitForInit();
|
||||
EXPECT_EQ(object.isRemoteDead_, true);
|
||||
EXPECT_EQ(object.isFinishInit_, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -487,7 +488,8 @@ HWTEST_F(IPCObjectProxyTest, WaitForInitTest003, TestSize.Level1)
|
||||
IPCObjectProxy object(1);
|
||||
|
||||
object.isRemoteDead_ = false;
|
||||
object.proto_ = IRemoteObject::IF_PROT_ERROR;
|
||||
object.isFinishInit_ = true;
|
||||
object.proto_ = IRemoteObject::IF_PROT_DATABUS;
|
||||
|
||||
IPCProcessSkeleton *current = IPCProcessSkeleton::GetCurrent();
|
||||
current->proxyToSession_.clear();
|
||||
@ -505,12 +507,13 @@ HWTEST_F(IPCObjectProxyTest, WaitForInitTest004, TestSize.Level1)
|
||||
IPCObjectProxy object(1);
|
||||
|
||||
object.isRemoteDead_ = false;
|
||||
object.isFinishInit_ = true;
|
||||
object.proto_ = IRemoteObject::IF_PROT_ERROR;
|
||||
|
||||
IPCProcessSkeleton *current = IPCProcessSkeleton::GetCurrent();
|
||||
current->proxyToSession_.clear();
|
||||
object.WaitForInit();
|
||||
EXPECT_EQ(object.isRemoteDead_, true);
|
||||
EXPECT_EQ(object.isRemoteDead_, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -29,6 +29,10 @@ using namespace testing::ext;
|
||||
using namespace OHOS;
|
||||
using namespace OHOS::HiviewDFX;
|
||||
|
||||
namespace {
|
||||
constexpr int TEST_STUB_INDEX = 1234;
|
||||
}
|
||||
|
||||
class DBinderServiceUnitTest : public testing::Test {
|
||||
public:
|
||||
static void SetUpTestCase(void);
|
||||
@ -677,6 +681,7 @@ HWTEST_F(DBinderServiceUnitTest, OnRemoteInvokerMessage002, TestSize.Level1)
|
||||
std::shared_ptr<struct DHandleEntryTxRx> message = std::make_shared<DHandleEntryTxRx>();
|
||||
EXPECT_TRUE(message != nullptr);
|
||||
memset_s(message.get(), sizeof(DHandleEntryTxRx), 0, sizeof(DHandleEntryTxRx));
|
||||
message->stubIndex = TEST_STUB_INDEX;
|
||||
dBinderService->dbinderCallback_ = std::make_shared<TestRpcSystemAbilityCallback>();
|
||||
EXPECT_TRUE(dBinderService->dbinderCallback_ != nullptr);
|
||||
bool res = dBinderService->OnRemoteInvokerMessage(message);
|
||||
|
Loading…
Reference in New Issue
Block a user