codecheck

Signed-off-by: wangyb0625 <wangyibo38@huawei.com>
This commit is contained in:
wangyb0625
2022-05-24 16:54:19 +08:00
parent 92b0146352
commit f0e92fd170
5 changed files with 8 additions and 7 deletions
+1
View File
@@ -74,6 +74,7 @@ enum {
ERR_DM_AUTH_NOT_START = -20026,
ERR_DM_AUTH_MESSAGE_INCOMPLETE = -20027,
ERR_DM_CREATE_GROUP_FAILED = -20028,
ERR_DM_IPC_READ_TOKEN_FAILED = -20029,
};
const std::string TARGET_PKG_NAME_KEY = "targetPkgName";
@@ -29,7 +29,7 @@ int32_t IpcClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messa
auto remoteDescriptor = data.ReadInterfaceToken();
if (GetDescriptor() != remoteDescriptor) {
LOGI("ReadInterfaceToken fail!");
return ERR_INVALID_STATE;
return ERR_DM_IPC_READ_TOKEN_FAILED;
}
if (IpcCmdRegister::GetInstance().OnIpcCmd((int32_t)code, data, reply) == DM_OK) {
@@ -84,7 +84,7 @@ int32_t IpcServerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messa
auto remoteDescriptor = data.ReadInterfaceToken();
if (GetDescriptor() != remoteDescriptor) {
LOGI("ReadInterfaceToken fail!");
return ERR_INVALID_STATE;
return ERR_DM_IPC_READ_TOKEN_FAILED;
}
int32_t ret = IpcCmdRegister::GetInstance().OnIpcCmd((int32_t)code, data, reply);
+3 -3
View File
@@ -87,7 +87,7 @@ HWTEST_F(IpcClientStubTest, OnRemoteRequest_001, testing::ext::TestSize.Level0)
* set MessageParcel not null
* 2. set set code is SERVER_DEVICE_FA_NOTIFY
* 3. call IpcClientStub OnRemoteRequest with parameter
* 4. check result is ERR_INVALID_STATE
* 4. check result is ERR_DM_IPC_READ_TOKEN_FAILED
* @tc.type: FUNC
* @tc.require: AR000GHSJK
*/
@@ -104,8 +104,8 @@ HWTEST_F(IpcClientStubTest, OnRemoteRequest_002, testing::ext::TestSize.Level0)
sptr<IpcClientStub> instance = new IpcClientStub();
// 3. call IpcClientStub OnRemoteRequest with parameter
int ret = instance->OnRemoteRequest(code, data, reply, option);
// 4. check result is ERR_INVALID_STATE
ASSERT_EQ(ret, ERR_INVALID_STATE);
// 4. check result is ERR_DM_IPC_READ_TOKEN_FAILED
ASSERT_EQ(ret, ERR_DM_IPC_READ_TOKEN_FAILED);
}
/**
+2 -2
View File
@@ -168,8 +168,8 @@ HWTEST_F(IpcServerStubTest, OnRemoteRequest_002, testing::ext::TestSize.Level0)
int ret = 0;
// 2. Call IpcServerStub OnRemoteRequest with param
ret = IpcServerStub::GetInstance().OnRemoteRequest(code, data, reply, option);
// 3. check ret not ERR_INVALID_STATE
ASSERT_EQ(ret, ERR_INVALID_STATE);
// 3. check ret not ERR_DM_IPC_READ_TOKEN_FAILED
ASSERT_EQ(ret, ERR_DM_IPC_READ_TOKEN_FAILED);
}
/**