• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "UTTest_ipc_cmd_parser_service.h"
17 
18 #include <unistd.h>
19 
20 #include "device_manager_ipc_interface_code.h"
21 #include "device_manager_notify.h"
22 #include "dm_anonymous.h"
23 #include "dm_constants.h"
24 #include "dm_device_info.h"
25 #include "ipc_client_manager.h"
26 #include "ipc_cmd_register.h"
27 #include "ipc_common_param_req.h"
28 #include "ipc_create_pin_holder_req.h"
29 #include "ipc_credential_auth_status_req.h"
30 #include "ipc_destroy_pin_holder_req.h"
31 #include "ipc_get_info_by_network_req.h"
32 #include "ipc_get_info_by_network_rsp.h"
33 #include "ipc_get_local_device_info_rsp.h"
34 #include "ipc_get_trustdevice_req.h"
35 #include "ipc_get_trustdevice_rsp.h"
36 #include "ipc_notify_auth_result_req.h"
37 #include "ipc_notify_bind_result_req.h"
38 #include "ipc_notify_credential_req.h"
39 #include "ipc_notify_device_discovery_req.h"
40 #include "ipc_notify_dmfa_result_req.h"
41 #include "ipc_notify_event_req.h"
42 #include "ipc_notify_pin_holder_event_req.h"
43 #include "ipc_notify_publish_result_req.h"
44 #include "ipc_publish_req.h"
45 #include "ipc_register_serviceinfo_req.h"
46 #include "ipc_register_listener_req.h"
47 #include "ipc_req.h"
48 #include "ipc_set_credential_req.h"
49 #include "ipc_set_credential_rsp.h"
50 #include "ipc_set_useroperation_req.h"
51 #include "ipc_unauthenticate_device_req.h"
52 #include "ipc_unpublish_req.h"
53 #include "json_object.h"
54 
55 namespace OHOS {
56 namespace DistributedHardware {
SetUp()57 void IpcCmdParserServiceTest::SetUp()
58 {
59 }
60 
TearDown()61 void IpcCmdParserServiceTest::TearDown()
62 {
63 }
64 
SetUpTestCase()65 void IpcCmdParserServiceTest::SetUpTestCase()
66 {
67 }
68 
TearDownTestCase()69 void IpcCmdParserServiceTest::TearDownTestCase()
70 {
71 }
72 
73 namespace {
GetIpcRequestFunc(int32_t cmdCode)74 SetIpcRequestFunc GetIpcRequestFunc(int32_t cmdCode)
75 {
76     SetIpcRequestFunc ptr = nullptr;
77     auto setRequestMapIter = IpcCmdRegister::GetInstance().setIpcRequestFuncMap_.find(cmdCode);
78     if (setRequestMapIter != IpcCmdRegister::GetInstance().setIpcRequestFuncMap_.end()) {
79         ptr = setRequestMapIter->second;
80     }
81     return ptr;
82 }
83 
GetResponseFunc(int32_t cmdCode)84 ReadResponseFunc GetResponseFunc(int32_t cmdCode)
85 {
86     auto readResponseMapIter = IpcCmdRegister::GetInstance().readResponseFuncMap_.find(cmdCode);
87     if (readResponseMapIter == IpcCmdRegister::GetInstance().readResponseFuncMap_.end()) {
88         return nullptr;
89     }
90     return readResponseMapIter->second;
91 }
92 
GetIpcCmdFunc(int32_t cmdCode)93 OnIpcCmdFunc GetIpcCmdFunc(int32_t cmdCode)
94 {
95     auto onIpcCmdMapIter = IpcCmdRegister::GetInstance().onIpcCmdFuncMap_.find(cmdCode);
96     if (onIpcCmdMapIter == IpcCmdRegister::GetInstance().onIpcCmdFuncMap_.end()) {
97         return nullptr;
98     }
99     return onIpcCmdMapIter->second;
100 }
101 
TestIpcRequestFuncReqNull(int32_t cmdCode)102 int32_t TestIpcRequestFuncReqNull(int32_t cmdCode)
103 {
104     MessageParcel data;
105     std::shared_ptr<IpcReq> req = nullptr;
106     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
107     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
108     if (ptr) {
109         ret = ptr(req, data);
110     }
111     return ret;
112 }
113 
TestReadResponseRspNull(int32_t cmdCode)114 int32_t TestReadResponseRspNull(int32_t cmdCode)
115 {
116     MessageParcel reply;
117     std::shared_ptr<IpcRsp> rsp = nullptr;
118     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
119     ReadResponseFunc ptr = GetResponseFunc(cmdCode);
120     if (ptr) {
121         ret = ptr(reply, rsp);
122     }
123     return ret;
124 }
125 
TestReadResponseRspNotNull(int32_t cmdCode)126 int32_t TestReadResponseRspNotNull(int32_t cmdCode)
127 {
128     MessageParcel reply;
129     std::shared_ptr<IpcRsp> rsp = std::make_shared<IpcRsp>();
130     int32_t retCode = 0;
131     reply.WriteInt32(retCode);
132     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
133     ReadResponseFunc ptr = GetResponseFunc(cmdCode);
134     if (ptr) {
135         ret = ptr(reply, rsp);
136     }
137     return ret;
138 }
139 
EncodePeerTargetId(const PeerTargetId & targetId,MessageParcel & parcel)140 bool EncodePeerTargetId(const PeerTargetId &targetId, MessageParcel &parcel)
141 {
142     bool bRet = true;
143     bRet = (bRet && parcel.WriteString(targetId.deviceId));
144     bRet = (bRet && parcel.WriteString(targetId.brMac));
145     bRet = (bRet && parcel.WriteString(targetId.bleMac));
146     bRet = (bRet && parcel.WriteString(targetId.wifiIp));
147     bRet = (bRet && parcel.WriteUint16(targetId.wifiPort));
148     return bRet;
149 }
150 
151 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_001, testing::ext::TestSize.Level0)
152 {
153     int32_t cmdCode = SERVER_DEVICE_STATE_NOTIFY;
154     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
155 }
156 
157 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_001, testing::ext::TestSize.Level0)
158 {
159     int32_t cmdCode = SERVER_DEVICE_STATE_NOTIFY;
160     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
161 }
162 
163 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_002, testing::ext::TestSize.Level0)
164 {
165     int32_t cmdCode = SERVER_DEVICE_STATE_NOTIFY;
166     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
167 }
168 
169 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_002, testing::ext::TestSize.Level0)
170 {
171     int32_t cmdCode = SERVER_DEVICE_FOUND;
172     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
173 }
174 
175 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_003, testing::ext::TestSize.Level0)
176 {
177     int32_t cmdCode = SERVER_DEVICE_FOUND;
178     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
179 }
180 
181 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_004, testing::ext::TestSize.Level0)
182 {
183     int32_t cmdCode = SERVER_DEVICE_FOUND;
184     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
185 }
186 
187 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_003, testing::ext::TestSize.Level0)
188 {
189     int32_t cmdCode = SERVER_DEVICE_DISCOVERY;
190     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
191 }
192 
193 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_005, testing::ext::TestSize.Level0)
194 {
195     int32_t cmdCode = SERVER_DEVICE_DISCOVERY;
196     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
197 }
198 
199 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_006, testing::ext::TestSize.Level0)
200 {
201     int32_t cmdCode = SERVER_DEVICE_DISCOVERY;
202     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
203 }
204 
205 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_004, testing::ext::TestSize.Level0)
206 {
207     int32_t cmdCode = SERVER_DISCOVER_FINISH;
208     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
209 }
210 
211 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_007, testing::ext::TestSize.Level0)
212 {
213     int32_t cmdCode = SERVER_DISCOVER_FINISH;
214     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
215 }
216 
217 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_008, testing::ext::TestSize.Level0)
218 {
219     int32_t cmdCode = SERVER_DISCOVER_FINISH;
220     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
221 }
222 
223 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_005, testing::ext::TestSize.Level0)
224 {
225     int32_t cmdCode = SERVER_PUBLISH_FINISH;
226     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
227 }
228 
229 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_009, testing::ext::TestSize.Level0)
230 {
231     int32_t cmdCode = SERVER_PUBLISH_FINISH;
232     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
233 }
234 
235 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_010, testing::ext::TestSize.Level0)
236 {
237     int32_t cmdCode = SERVER_PUBLISH_FINISH;
238     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
239 }
240 
241 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_006, testing::ext::TestSize.Level0)
242 {
243     int32_t cmdCode = SERVER_AUTH_RESULT;
244     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
245 }
246 
247 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_011, testing::ext::TestSize.Level0)
248 {
249     int32_t cmdCode = SERVER_AUTH_RESULT;
250     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
251 }
252 
253 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_012, testing::ext::TestSize.Level0)
254 {
255     int32_t cmdCode = SERVER_AUTH_RESULT;
256     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
257 }
258 
259 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_007, testing::ext::TestSize.Level0)
260 {
261     int32_t cmdCode = SERVER_DEVICE_FA_NOTIFY;
262     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
263 }
264 
265 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_013, testing::ext::TestSize.Level0)
266 {
267     int32_t cmdCode = SERVER_DEVICE_FA_NOTIFY;
268     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
269 }
270 
271 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_014, testing::ext::TestSize.Level0)
272 {
273     int32_t cmdCode = SERVER_DEVICE_FA_NOTIFY;
274     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
275 }
276 
277 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_008, testing::ext::TestSize.Level0)
278 {
279     int32_t cmdCode = SERVER_CREDENTIAL_RESULT;
280     MessageParcel data;
281     std::shared_ptr<IpcNotifyCredentialReq> req = nullptr;
282     int ret = ERR_DM_FAILED;
283     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
284     if (ptr) {
285         ret = ptr(req, data);
286     }
287     ASSERT_EQ(ret, ERR_DM_FAILED);
288 
289     req = std::make_shared<IpcNotifyCredentialReq>();
290     if (ptr) {
291         ret = ptr(req, data);
292     }
293     ASSERT_EQ(ret, DM_OK);
294 }
295 
296 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_015, testing::ext::TestSize.Level0)
297 {
298     int32_t cmdCode = SERVER_CREDENTIAL_RESULT;
299     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
300 }
301 
302 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_016, testing::ext::TestSize.Level0)
303 {
304     int32_t cmdCode = SERVER_CREDENTIAL_RESULT;
305     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
306 }
307 
308 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_009, testing::ext::TestSize.Level0)
309 {
310     int32_t cmdCode = BIND_TARGET_RESULT;
311     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
312 }
313 
314 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_017, testing::ext::TestSize.Level0)
315 {
316     int32_t cmdCode = BIND_TARGET_RESULT;
317     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
318 }
319 
320 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_018, testing::ext::TestSize.Level0)
321 {
322     int32_t cmdCode = BIND_TARGET_RESULT;
323     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
324 }
325 
326 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_010, testing::ext::TestSize.Level0)
327 {
328     int32_t cmdCode = UNBIND_TARGET_RESULT;
329     ASSERT_EQ(ERR_DM_FAILED, TestIpcRequestFuncReqNull(cmdCode));
330 }
331 
332 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_019, testing::ext::TestSize.Level0)
333 {
334     int32_t cmdCode = UNBIND_TARGET_RESULT;
335     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
336 }
337 
338 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_020, testing::ext::TestSize.Level0)
339 {
340     int32_t cmdCode = UNBIND_TARGET_RESULT;
341     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
342 }
343 
344 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_011, testing::ext::TestSize.Level0)
345 {
346     int32_t cmdCode = SERVER_CREATE_PIN_HOLDER;
347     MessageParcel data;
348     std::shared_ptr<IpcReq> req = nullptr;
349     int ret = ERR_DM_FAILED;
350     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
351     if (ptr) {
352         ret = ptr(req, data);
353     }
354     ASSERT_EQ(ret, ERR_DM_FAILED);
355 
356     req = std::make_shared<IpcCreatePinHolderReq>();
357     std::string pkgName = "com.ohos.test";
358     req->SetPkgName(pkgName);
359     if (ptr) {
360         ret = ptr(req, data);
361     }
362     ASSERT_EQ(ret, DM_OK);
363 }
364 
365 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_021, testing::ext::TestSize.Level0)
366 {
367     int32_t cmdCode = SERVER_CREATE_PIN_HOLDER;
368     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
369 }
370 
371 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_022, testing::ext::TestSize.Level0)
372 {
373     int32_t cmdCode = SERVER_CREATE_PIN_HOLDER;
374     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
375 }
376 
377 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_012, testing::ext::TestSize.Level0)
378 {
379     int32_t cmdCode = SERVER_DESTROY_PIN_HOLDER;
380     MessageParcel data;
381     std::shared_ptr<IpcReq> req = nullptr;
382     int ret = ERR_DM_FAILED;
383     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
384     if (ptr) {
385         ret = ptr(req, data);
386     }
387     ASSERT_EQ(ret, ERR_DM_FAILED);
388 
389     req = std::make_shared<IpcDestroyPinHolderReq>();
390     std::string pkgName = "com.ohos.test";
391     req->SetPkgName(pkgName);
392     if (ptr) {
393         ret = ptr(req, data);
394     }
395     ASSERT_EQ(ret, DM_OK);
396 }
397 
398 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_023, testing::ext::TestSize.Level0)
399 {
400     int32_t cmdCode = SERVER_DESTROY_PIN_HOLDER;
401     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
402 }
403 
404 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_024, testing::ext::TestSize.Level0)
405 {
406     int32_t cmdCode = SERVER_DESTROY_PIN_HOLDER;
407     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
408 }
409 
410 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_013, testing::ext::TestSize.Level0)
411 {
412     int32_t cmdCode = SERVER_CREATE_PIN_HOLDER_RESULT;
413     MessageParcel data;
414     std::shared_ptr<IpcReq> req = nullptr;
415     int ret = ERR_DM_FAILED;
416     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
417     if (ptr) {
418         ret = ptr(req, data);
419     }
420     ASSERT_EQ(ret, ERR_DM_FAILED);
421 
422     req = std::make_shared<IpcNotifyPublishResultReq>();
423     std::string pkgName = "com.ohos.test";
424     req->SetPkgName(pkgName);
425     if (ptr) {
426         ret = ptr(req, data);
427     }
428     ASSERT_EQ(ret, DM_OK);
429 }
430 
431 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_025, testing::ext::TestSize.Level0)
432 {
433     int32_t cmdCode = SERVER_CREATE_PIN_HOLDER_RESULT;
434     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
435 }
436 
437 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_026, testing::ext::TestSize.Level0)
438 {
439     int32_t cmdCode = SERVER_CREATE_PIN_HOLDER_RESULT;
440     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
441 }
442 
443 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_014, testing::ext::TestSize.Level0)
444 {
445     int32_t cmdCode = SERVER_DESTROY_PIN_HOLDER_RESULT;
446     MessageParcel data;
447     std::shared_ptr<IpcReq> req = nullptr;
448     int ret = ERR_DM_FAILED;
449     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
450     if (ptr) {
451         ret = ptr(req, data);
452     }
453     ASSERT_EQ(ret, ERR_DM_FAILED);
454 
455     req = std::make_shared<IpcNotifyPublishResultReq>();
456     std::string pkgName = "com.ohos.test";
457     req->SetPkgName(pkgName);
458     if (ptr) {
459         ret = ptr(req, data);
460     }
461     ASSERT_EQ(ret, DM_OK);
462 }
463 
464 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_027, testing::ext::TestSize.Level0)
465 {
466     int32_t cmdCode = SERVER_DESTROY_PIN_HOLDER_RESULT;
467     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
468 }
469 
470 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_028, testing::ext::TestSize.Level0)
471 {
472     int32_t cmdCode = SERVER_DESTROY_PIN_HOLDER_RESULT;
473     ASSERT_EQ(TestReadResponseRspNotNull(cmdCode), DM_OK);
474 }
475 
476 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_001, testing::ext::TestSize.Level0)
477 {
478     int32_t cmdCode = BIND_DEVICE;
479     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
480     MessageParcel data;
481     MessageParcel reply;
482     std::string pkgName = "ohos.dm.test";
483     std::string deviceId = "xxx";
484     data.WriteString(pkgName);
485     data.WriteString("");
486     data.WriteString(deviceId);
487     data.WriteInt32(1);
488     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
489     if (ptr) {
490         ret = ptr(data, reply);
491     }
492     ASSERT_EQ(ret, DM_OK);
493 }
494 
495 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_002, testing::ext::TestSize.Level0)
496 {
497     int32_t cmdCode = UNBIND_DEVICE;
498     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
499     MessageParcel data;
500     MessageParcel reply;
501     std::string pkgName = "ohos.dm.test";
502     std::string deviceId = "xxx";
503     data.WriteString(pkgName);
504     data.WriteString(deviceId);
505     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
506     if (ptr) {
507         ret = ptr(data, reply);
508     }
509     ASSERT_EQ(ret, DM_OK);
510 }
511 
512 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_003, testing::ext::TestSize.Level0)
513 {
514     int32_t cmdCode = GET_NETWORKTYPE_BY_NETWORK;
515     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
516     MessageParcel data;
517     MessageParcel reply;
518     std::string pkgName = "ohos.dm.test";
519     std::string networkId = "xxx";
520     data.WriteString(pkgName);
521     data.WriteString(networkId);
522     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
523     if (ptr) {
524         ret = ptr(data, reply);
525     }
526     ASSERT_EQ(ret, DM_OK);
527 }
528 
529 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_004, testing::ext::TestSize.Level0)
530 {
531     int32_t cmdCode = REGISTER_UI_STATE_CALLBACK;
532     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
533     MessageParcel data;
534     MessageParcel reply;
535     std::string pkgName = "ohos.dm.test";
536     data.WriteString(pkgName);
537     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
538     if (ptr) {
539         ret = ptr(data, reply);
540     }
541     ASSERT_EQ(ret, DM_OK);
542 }
543 
544 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_005, testing::ext::TestSize.Level0)
545 {
546     int32_t cmdCode = UNREGISTER_UI_STATE_CALLBACK;
547     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
548     MessageParcel data;
549     MessageParcel reply;
550     std::string pkgName = "ohos.dm.test";
551     data.WriteString(pkgName);
552     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
553     if (ptr) {
554         ret = ptr(data, reply);
555     }
556     ASSERT_EQ(ret, DM_OK);
557 }
558 
559 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_006, testing::ext::TestSize.Level0)
560 {
561     int32_t cmdCode = IMPORT_AUTH_CODE;
562     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
563     MessageParcel data;
564     MessageParcel reply;
565     std::string pkgName = "ohos.dm.test";
566     std::string authCode = "123456";
567     data.WriteString(pkgName);
568     data.WriteString(authCode);
569     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
570     if (ptr) {
571         ret = ptr(data, reply);
572     }
573     ASSERT_EQ(ret, DM_OK);
574 }
575 
576 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_007, testing::ext::TestSize.Level0)
577 {
578     int32_t cmdCode = EXPORT_AUTH_CODE;
579     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
580     MessageParcel data;
581     MessageParcel reply;
582     std::string pkgName = "ohos.dm.test";
583     data.WriteString(pkgName);
584     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
585     if (ptr) {
586         ret = ptr(data, reply);
587     }
588     ASSERT_EQ(ret, DM_OK);
589 }
590 
591 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_008, testing::ext::TestSize.Level0)
592 {
593     int32_t cmdCode = REGISTER_DISCOVERY_CALLBACK;
594     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
595     MessageParcel data;
596     MessageParcel reply;
597     std::string pkgName = "ohos.dm.test";
598     std::string param = "xxx";
599     data.WriteString(pkgName);
600     data.WriteString(param);
601     data.WriteString(param);
602     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
603     if (ptr) {
604         ret = ptr(data, reply);
605     }
606     ASSERT_EQ(ret, DM_OK);
607 }
608 
609 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_009, testing::ext::TestSize.Level0)
610 {
611     int32_t cmdCode = UNREGISTER_DISCOVERY_CALLBACK;
612     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
613     MessageParcel data;
614     MessageParcel reply;
615     std::string pkgName = "ohos.dm.test";
616     std::string param = "xxx";
617     data.WriteString(pkgName);
618     data.WriteString(param);
619     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
620     if (ptr) {
621         ret = ptr(data, reply);
622     }
623     ASSERT_EQ(ret, DM_OK);
624 }
625 
626 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_010, testing::ext::TestSize.Level0)
627 {
628     int32_t cmdCode = START_DISCOVERING;
629     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
630     MessageParcel data;
631     MessageParcel reply;
632     std::string pkgName = "ohos.dm.test";
633     std::string param = "xxx";
634     data.WriteString(pkgName);
635     data.WriteString(param);
636     data.WriteString(param);
637     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
638     if (ptr) {
639         ret = ptr(data, reply);
640     }
641     ASSERT_EQ(ret, DM_OK);
642 }
643 
644 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_011, testing::ext::TestSize.Level0)
645 {
646     int32_t cmdCode = STOP_DISCOVERING;
647     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
648     MessageParcel data;
649     MessageParcel reply;
650     std::string pkgName = "ohos.dm.test";
651     std::string param = "xxx";
652     data.WriteString(pkgName);
653     data.WriteString(param);
654     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
655     if (ptr) {
656         ret = ptr(data, reply);
657     }
658     ASSERT_EQ(ret, DM_OK);
659 }
660 
661 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_012, testing::ext::TestSize.Level0)
662 {
663     int32_t cmdCode = START_ADVERTISING;
664     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
665     MessageParcel data;
666     MessageParcel reply;
667     std::string pkgName = "ohos.dm.test";
668     std::string param = "xxx";
669     data.WriteString(pkgName);
670     data.WriteString(param);
671     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
672     if (ptr) {
673         ret = ptr(data, reply);
674     }
675     ASSERT_EQ(ret, DM_OK);
676 }
677 
678 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_013, testing::ext::TestSize.Level0)
679 {
680     int32_t cmdCode = STOP_ADVERTISING;
681     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
682     MessageParcel data;
683     MessageParcel reply;
684     std::string pkgName = "ohos.dm.test";
685     std::string param = "xxx";
686     data.WriteString(pkgName);
687     data.WriteString(param);
688     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
689     if (ptr) {
690         ret = ptr(data, reply);
691     }
692     ASSERT_EQ(ret, DM_OK);
693 }
694 
695 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_014, testing::ext::TestSize.Level0)
696 {
697     int32_t cmdCode = BIND_TARGET;
698     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
699     MessageParcel data;
700     MessageParcel reply;
701     std::string pkgName = "ohos.dm.test";
702     std::string param = "xxx";
703     data.WriteString(pkgName);
704     PeerTargetId targetId;
705     EncodePeerTargetId(targetId, data);
706     data.WriteString(param);
707     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
708     if (ptr) {
709         ret = ptr(data, reply);
710     }
711     ASSERT_EQ(ret, DM_OK);
712 }
713 
714 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_015, testing::ext::TestSize.Level0)
715 {
716     int32_t cmdCode = UNBIND_TARGET;
717     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
718     MessageParcel data;
719     MessageParcel reply;
720     std::string pkgName = "ohos.dm.test";
721     std::string param = "xxx";
722     data.WriteString(pkgName);
723     PeerTargetId targetId;
724     EncodePeerTargetId(targetId, data);
725     data.WriteString(param);
726     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
727     if (ptr) {
728         ret = ptr(data, reply);
729     }
730     ASSERT_EQ(ret, DM_OK);
731 }
732 
733 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_016, testing::ext::TestSize.Level0)
734 {
735     int32_t cmdCode = REGISTER_PIN_HOLDER_CALLBACK;
736     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
737     MessageParcel data;
738     MessageParcel reply;
739     std::string pkgName = "ohos.dm.test";
740     data.WriteString(pkgName);
741     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
742     if (ptr) {
743         ret = ptr(data, reply);
744     }
745     ASSERT_EQ(ret, DM_OK);
746 }
747 
748 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_017, testing::ext::TestSize.Level0)
749 {
750     int32_t cmdCode = CREATE_PIN_HOLDER;
751     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
752     MessageParcel data;
753     MessageParcel reply;
754     std::string pkgName = "ohos.dm.test";
755     data.WriteString(pkgName);
756     PeerTargetId targetId;
757     EncodePeerTargetId(targetId, data);
758     std::string param = "xxx";
759     data.WriteString(param);
760     data.WriteInt32(1);
761     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
762     if (ptr) {
763         ret = ptr(data, reply);
764     }
765     ASSERT_EQ(ret, DM_OK);
766 }
767 
768 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_018, testing::ext::TestSize.Level0)
769 {
770     int32_t cmdCode = DESTROY_PIN_HOLDER;
771     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
772     MessageParcel data;
773     MessageParcel reply;
774     std::string pkgName = "ohos.dm.test";
775     data.WriteString(pkgName);
776     PeerTargetId targetId;
777     EncodePeerTargetId(targetId, data);
778     std::string param = "xxx";
779     data.WriteString(param);
780     data.WriteString(param);
781     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
782     if (ptr) {
783         ret = ptr(data, reply);
784     }
785     ASSERT_EQ(ret, DM_OK);
786 }
787 
788 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_019, testing::ext::TestSize.Level0)
789 {
790     int32_t cmdCode = DP_ACL_ADD;
791     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
792     MessageParcel data;
793     MessageParcel reply;
794     std::string pkgName = "ohos.dm.test";
795     data.WriteString(pkgName);
796     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
797     if (ptr) {
798         ret = ptr(data, reply);
799     }
800     ASSERT_EQ(ret, DM_OK);
801 }
802 
803 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_020, testing::ext::TestSize.Level0)
804 {
805     int32_t cmdCode = GET_SECURITY_LEVEL;
806     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
807     MessageParcel data;
808     MessageParcel reply;
809     std::string pkgName = "ohos.dm.test";
810     std::string networkId = "xxx";
811     data.WriteString(pkgName);
812     data.WriteString(networkId);
813     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
814     if (ptr) {
815         ret = ptr(data, reply);
816     }
817     ASSERT_EQ(ret, DM_OK);
818 }
819 
820 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_021, testing::ext::TestSize.Level0)
821 {
822     int32_t cmdCode = IS_SAME_ACCOUNT;
823     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
824     MessageParcel data;
825     MessageParcel reply;
826     std::string udid = "xxx";
827     data.WriteString(udid);
828     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
829     if (ptr) {
830         ret = ptr(data, reply);
831     }
832     ASSERT_EQ(ret, DM_OK);
833 }
834 
835 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_022, testing::ext::TestSize.Level0)
836 {
837     int32_t cmdCode = CHECK_API_PERMISSION;
838     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
839     MessageParcel data;
840     MessageParcel reply;
841     data.WriteInt32(1);
842     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
843     if (ptr) {
844         ret = ptr(data, reply);
845     }
846     ASSERT_EQ(ret, DM_OK);
847 }
848 
849 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_023, testing::ext::TestSize.Level0)
850 {
851     int32_t cmdCode = GET_TRUST_DEVICE_LIST;
852     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
853     MessageParcel data;
854     MessageParcel reply;
855     std::string pkgName = "ohos.dm.test";
856     std::string extra = "";
857     bool isRefresh = true;
858     data.WriteString(pkgName);
859     data.WriteString(extra);
860     data.WriteBool(isRefresh);
861     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
862     if (ptr) {
863         ret = ptr(data, reply);
864     }
865     ASSERT_EQ(ret, DM_OK);
866 }
867 
868 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_025, testing::ext::TestSize.Level0)
869 {
870     int32_t cmdCode = REGISTER_DEVICE_MANAGER_LISTENER;
871     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
872     MessageParcel data;
873     MessageParcel reply;
874     std::string pkgName = "pkgName";
875     data.WriteString(pkgName);
876     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
877     if (ptr) {
878         ret = ptr(data, reply);
879     }
880     ASSERT_EQ(ret, ERR_DM_POINT_NULL);
881 
882     data.WriteString(pkgName);
883     sptr<IRemoteObject> remoteObject = nullptr;
884     data.WriteRemoteObject(remoteObject);
885 
886     if (ptr) {
887         ret = ptr(data, reply);
888     }
889     ASSERT_EQ(ret, ERR_DM_POINT_NULL);
890 
891     data.WriteString(pkgName);
892     remoteObject = sptr<IpcClientStub>(new IpcClientStub());
893     data.WriteRemoteObject(remoteObject);
894 
895     if (ptr) {
896         ret = ptr(data, reply);
897     }
898     ASSERT_EQ(ret, DM_OK);
899 }
900 
901 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_026, testing::ext::TestSize.Level0)
902 {
903     int32_t cmdCode = UNREGISTER_DEVICE_MANAGER_LISTENER;
904     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
905     MessageParcel data;
906     MessageParcel reply;
907     std::string pkgName = "ohos.dm.test";
908     data.WriteString(pkgName);
909     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
910     if (ptr) {
911         ret = ptr(data, reply);
912     }
913     ASSERT_EQ(ret, DM_OK);
914 }
915 
916 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_030, testing::ext::TestSize.Level0)
917 {
918     int32_t cmdCode = PUBLISH_DEVICE_DISCOVER;
919     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
920     MessageParcel data;
921     MessageParcel reply;
922     std::string pkgName = "ohos.dm.test";
923     DmPublishInfo dmPublishInfo;
924     dmPublishInfo.publishId = 1000;
925     data.WriteString(pkgName);
926     data.WriteRawData(&dmPublishInfo, sizeof(DmPublishInfo));
927     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
928     if (ptr) {
929         ret = ptr(data, reply);
930     }
931     ASSERT_EQ(ret, DM_OK);
932 }
933 
934 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_031, testing::ext::TestSize.Level0)
935 {
936     int32_t cmdCode = UNPUBLISH_DEVICE_DISCOVER;
937     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
938     MessageParcel data;
939     MessageParcel reply;
940     std::string pkgName = "ohos.dm.test";
941     int32_t publishId = 1000;
942     data.WriteString(pkgName);
943     data.WriteInt32(publishId);
944     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
945     if (ptr) {
946         ret = ptr(data, reply);
947     }
948     ASSERT_EQ(ret, DM_OK);
949 }
950 
951 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_032, testing::ext::TestSize.Level0)
952 {
953     int32_t cmdCode = AUTHENTICATE_DEVICE;
954     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
955     MessageParcel data;
956     MessageParcel reply;
957     std::string pkgName = "ohos.dm.test";
958     std::string extra = "";
959     int32_t authType = 1;
960     DmDeviceInfo deviceInfo;
961     std::string deviceId = "12345678";
962     data.WriteString(pkgName);
963     data.WriteString(extra);
964     data.WriteString(deviceId);
965     data.WriteInt32(authType);
966     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
967     if (ptr) {
968         ret = ptr(data, reply);
969     }
970     ASSERT_EQ(ret, DM_OK);
971 }
972 
973 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_033, testing::ext::TestSize.Level0)
974 {
975     int32_t cmdCode = UNAUTHENTICATE_DEVICE;
976     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
977     MessageParcel data;
978     MessageParcel reply;
979     std::string pkgName = "ohos.dm.test";
980     std::string networkId = "12345678";
981     data.WriteString(pkgName);
982     data.WriteString(networkId);
983     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
984     if (ptr) {
985         ret = ptr(data, reply);
986     }
987     ASSERT_EQ(ret, DM_OK);
988 }
989 
990 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_034, testing::ext::TestSize.Level0)
991 {
992     int32_t cmdCode = GET_DEVICE_INFO;
993     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
994     MessageParcel data;
995     MessageParcel reply;
996     std::string pkgName = "ohos.dm.test";
997     std::string networkId = "12345678";
998     data.WriteString(pkgName);
999     data.WriteString(networkId);
1000     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1001     if (ptr) {
1002         ret = ptr(data, reply);
1003     }
1004     ASSERT_EQ(ret, DM_OK);
1005 }
1006 
1007 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_035, testing::ext::TestSize.Level0)
1008 {
1009     int32_t cmdCode = GET_LOCAL_DEVICE_INFO;
1010     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1011     MessageParcel data;
1012     MessageParcel reply;
1013     std::string pkgName = "ohos.dm.test";
1014     data.WriteString(pkgName);
1015     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1016     if (ptr) {
1017         ret = ptr(data, reply);
1018     }
1019     ASSERT_EQ(ret, DM_OK);
1020 }
1021 
1022 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_040, testing::ext::TestSize.Level0)
1023 {
1024     int32_t cmdCode = GET_UDID_BY_NETWORK;
1025     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1026     MessageParcel data;
1027     MessageParcel reply;
1028     std::string pkgName = "ohos.dm.test";
1029     std::string netWorkId = "12345678";
1030     data.WriteString(pkgName);
1031     data.WriteString(netWorkId);
1032     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1033     if (ptr) {
1034         ret = ptr(data, reply);
1035     }
1036     ASSERT_EQ(ret, DM_OK);
1037 }
1038 
1039 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_041, testing::ext::TestSize.Level0)
1040 {
1041     int32_t cmdCode = GET_UUID_BY_NETWORK;
1042     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1043     MessageParcel data;
1044     MessageParcel reply;
1045     std::string pkgName = "ohos.dm.test";
1046     std::string netWorkId = "12345678";
1047     data.WriteString(pkgName);
1048     data.WriteString(netWorkId);
1049     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1050     if (ptr) {
1051         ret = ptr(data, reply);
1052     }
1053     ASSERT_EQ(ret, DM_OK);
1054 }
1055 
1056 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_042, testing::ext::TestSize.Level0)
1057 {
1058     int32_t cmdCode = SERVER_USER_AUTH_OPERATION;
1059     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1060     MessageParcel data;
1061     MessageParcel reply;
1062     std::string pkgName = "ohos.dm.test";
1063     int32_t action = 1;
1064     std::string params = "";
1065     data.WriteString(pkgName);
1066     data.WriteInt32(action);
1067     data.WriteString(params);
1068     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1069     if (ptr) {
1070         ret = ptr(data, reply);
1071     }
1072     ASSERT_EQ(ret, ERR_DM_NO_PERMISSION);
1073 }
1074 
1075 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_043, testing::ext::TestSize.Level0)
1076 {
1077     int32_t cmdCode = REQUEST_CREDENTIAL;
1078     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1079     MessageParcel data;
1080     MessageParcel reply;
1081     std::string pkgName = "ohos.dm.test";
1082     std::string requestJsonStr = "";
1083     data.WriteString(pkgName);
1084     data.WriteString(requestJsonStr);
1085     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1086     if (ptr) {
1087         ret = ptr(data, reply);
1088     }
1089     ASSERT_EQ(ret, DM_OK);
1090 }
1091 
1092 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_044, testing::ext::TestSize.Level0)
1093 {
1094     int32_t cmdCode = IMPORT_CREDENTIAL;
1095     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1096     MessageParcel data;
1097     MessageParcel reply;
1098     std::string pkgName = "ohos.dm.test";
1099     std::string credentialInfo = "";
1100     data.WriteString(pkgName);
1101     data.WriteString(credentialInfo);
1102     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1103     if (ptr) {
1104         ret = ptr(data, reply);
1105     }
1106     ASSERT_EQ(ret, DM_OK);
1107 }
1108 
1109 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_045, testing::ext::TestSize.Level0)
1110 {
1111     int32_t cmdCode = DELETE_CREDENTIAL;
1112     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1113     MessageParcel data;
1114     MessageParcel reply;
1115     std::string pkgName = "ohos.dm.test";
1116     std::string deleteInfo = "";
1117     data.WriteString(pkgName);
1118     data.WriteString(deleteInfo);
1119     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1120     if (ptr) {
1121         ret = ptr(data, reply);
1122     }
1123     ASSERT_EQ(ret, DM_OK);
1124 }
1125 
1126 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_046, testing::ext::TestSize.Level0)
1127 {
1128     int32_t cmdCode = SERVER_GET_DMFA_INFO;
1129     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1130     MessageParcel data;
1131     MessageParcel reply;
1132     std::string pkgName = "ohos.dm.test";
1133     std::string reqJsonStr = "";
1134     data.WriteString(pkgName);
1135     data.WriteString(reqJsonStr);
1136     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1137     if (ptr) {
1138         ret = ptr(data, reply);
1139     }
1140     ASSERT_EQ(ret, DM_OK);
1141 }
1142 
1143 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_047, testing::ext::TestSize.Level0)
1144 {
1145     int32_t cmdCode = SERVER_GET_DMFA_INFO;
1146     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1147     MessageParcel data;
1148     MessageParcel reply;
1149     std::string pkgName = "ohos.dm.test";
1150     std::string reqJsonStr = "";
1151     data.WriteString(pkgName);
1152     data.WriteString(reqJsonStr);
1153     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1154     if (ptr) {
1155         ret = ptr(data, reply);
1156     }
1157     ASSERT_EQ(ret, DM_OK);
1158 }
1159 
1160 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_048, testing::ext::TestSize.Level0)
1161 {
1162     int32_t cmdCode = REGISTER_CREDENTIAL_CALLBACK;
1163     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1164     MessageParcel data;
1165     MessageParcel reply;
1166     std::string pkgName = "ohos.dm.test";
1167     data.WriteString(pkgName);
1168     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1169     if (ptr) {
1170         ret = ptr(data, reply);
1171     }
1172     ASSERT_EQ(ret, ERR_DM_NO_PERMISSION);
1173 }
1174 
1175 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_049, testing::ext::TestSize.Level0)
1176 {
1177     int32_t cmdCode = UNREGISTER_CREDENTIAL_CALLBACK;
1178     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1179     MessageParcel data;
1180     MessageParcel reply;
1181     std::string pkgName = "ohos.dm.test";
1182     data.WriteString(pkgName);
1183     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1184     if (ptr) {
1185         ret = ptr(data, reply);
1186     }
1187     ASSERT_EQ(ret, ERR_DM_NO_PERMISSION);
1188 }
1189 
1190 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_050, testing::ext::TestSize.Level0)
1191 {
1192     int32_t cmdCode = NOTIFY_EVENT;
1193     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1194     MessageParcel data;
1195     MessageParcel reply;
1196     std::string pkgName = "ohos.dm.test";
1197     int32_t eventId = 1;
1198     std::string event = "";
1199     data.WriteString(pkgName);
1200     data.WriteInt32(eventId);
1201     data.WriteString(event);
1202     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1203     if (ptr) {
1204         ret = ptr(data, reply);
1205     }
1206     ASSERT_EQ(ret, DM_OK);
1207 }
1208 
1209 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_051, testing::ext::TestSize.Level0)
1210 {
1211     int32_t cmdCode = GET_ENCRYPTED_UUID_BY_NETWOEKID;
1212     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1213     MessageParcel data;
1214     MessageParcel reply;
1215     std::string pkgName = "ohos.dm.test";
1216     std::string netWorkId = "123456789";
1217     data.WriteString(pkgName);
1218     data.WriteString(netWorkId);
1219     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1220     if (ptr) {
1221         ret = ptr(data, reply);
1222     }
1223     ASSERT_EQ(ret, DM_OK);
1224 }
1225 
1226 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_052, testing::ext::TestSize.Level0)
1227 {
1228     int32_t cmdCode = GENERATE_ENCRYPTED_UUID;
1229     int32_t ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1230     MessageParcel data;
1231     MessageParcel reply;
1232     std::string pkgName = "ohos.dm.test";
1233     std::string uuid = "123456789";
1234     std::string appId = "1234";
1235     data.WriteString(pkgName);
1236     data.WriteString(uuid);
1237     data.WriteString(appId);
1238     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1239     if (ptr) {
1240         ret = ptr(data, reply);
1241     }
1242     ASSERT_EQ(ret, DM_OK);
1243 }
1244 
1245 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_053, testing::ext::TestSize.Level0)
1246 {
1247     int32_t cmdCode = IMPORT_CREDENTIAL;
1248     int32_t ret = DM_OK;
1249     MessageParcel data;
1250     MessageParcel reply;
1251     std::string pkgName = "ohos.dm.test";
1252     JsonObject jsonObject;
1253     jsonObject[DM_CREDENTIAL_TYPE] = DM_TYPE_OH;
1254     jsonObject[DM_CREDENTIAL_REQJSONSTR] = "";
1255     std::string credentialInfo = jsonObject.Dump();
1256     data.WriteString(pkgName);
1257     data.WriteString(credentialInfo);
1258     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1259     if (ptr) {
1260         ret = ptr(data, reply);
1261     }
1262     ASSERT_EQ(ret, DM_OK);
1263 
1264     cmdCode = DELETE_CREDENTIAL;
1265     data.WriteString(pkgName);
1266     data.WriteString(credentialInfo);
1267     OnIpcCmdFunc ptr1 = GetIpcCmdFunc(cmdCode);
1268     if (ptr1) {
1269         ret = ptr1(data, reply);
1270     }
1271     ASSERT_EQ(ret, DM_OK);
1272 
1273     cmdCode = REQUEST_CREDENTIAL;
1274     data.WriteString(pkgName);
1275     data.WriteString(credentialInfo);
1276     OnIpcCmdFunc ptr2 = GetIpcCmdFunc(cmdCode);
1277     if (ptr2) {
1278         ret = ptr2(data, reply);
1279     }
1280     ASSERT_EQ(ret, DM_OK);
1281 }
1282 
1283 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_054, testing::ext::TestSize.Level0)
1284 {
1285     int32_t cmdCode = IMPORT_CREDENTIAL;
1286     int32_t ret = DM_OK;
1287     MessageParcel data;
1288     MessageParcel reply;
1289     std::string pkgName = "ohos.dm.test";
1290     JsonObject jsonObject;
1291     jsonObject[DM_CREDENTIAL_TYPE] = DM_TYPE_MINE;
1292     jsonObject[DM_CREDENTIAL_REQJSONSTR] = "";
1293     std::string credentialInfo = jsonObject.Dump();
1294     data.WriteString(pkgName);
1295     data.WriteString(credentialInfo);
1296     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1297     if (ptr) {
1298         ret = ptr(data, reply);
1299     }
1300     ASSERT_EQ(ret, DM_OK);
1301 
1302     cmdCode = DELETE_CREDENTIAL;
1303     data.WriteString(pkgName);
1304     data.WriteString(credentialInfo);
1305     OnIpcCmdFunc ptr1 = GetIpcCmdFunc(cmdCode);
1306     if (ptr1) {
1307         ret = ptr1(data, reply);
1308     }
1309     ASSERT_EQ(ret, DM_OK);
1310 
1311     cmdCode = REQUEST_CREDENTIAL;
1312     data.WriteString(pkgName);
1313     data.WriteString(credentialInfo);
1314     OnIpcCmdFunc ptr2 = GetIpcCmdFunc(cmdCode);
1315     if (ptr2) {
1316         ret = ptr2(data, reply);
1317     }
1318     ASSERT_EQ(ret, DM_OK);
1319 }
1320 
1321 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_060, testing::ext::TestSize.Level0)
1322 {
1323     int32_t cmdCode = REG_LOCALSERVICE_INFO;
1324     DMLocalServiceInfo serviceInfo;
1325     serviceInfo.bundleName = "testbundle";
1326     serviceInfo.extraInfo = "testextra";
1327     MessageParcel data;
1328     std::shared_ptr<IpcRegServiceInfoReq> req = std::make_shared<IpcRegServiceInfoReq>();
1329     req->SetLocalServiceInfo(serviceInfo);
1330 
1331     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1332     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1333     if (ptr) {
1334         ret = ptr(req, data);
1335     }
1336     ASSERT_EQ(DM_OK, ret);
1337 
1338     auto cmdptr = GetIpcCmdFunc(cmdCode);
1339     ASSERT_TRUE(cmdptr != nullptr);
1340     MessageParcel reply;
1341     EXPECT_EQ(cmdptr(data, reply), DM_OK);
1342 }
1343 
1344 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_061, testing::ext::TestSize.Level0)
1345 {
1346     int32_t cmdCode = UNREG_LOCALSERVICE_INFO;
1347     DMLocalServiceInfo serviceInfo;
1348     MessageParcel data;
1349     std::shared_ptr<IpcCommonParamReq> req = std::make_shared<IpcCommonParamReq>();
1350     req->SetFirstParam(std::string("testbundle"));
1351     req->SetInt32Param(100);
1352 
1353     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1354     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1355     if (ptr) {
1356         ret = ptr(req, data);
1357     }
1358     ASSERT_EQ(DM_OK, ret);
1359 
1360     auto cmdptr = GetIpcCmdFunc(cmdCode);
1361     ASSERT_TRUE(cmdptr != nullptr);
1362     MessageParcel reply;
1363     EXPECT_EQ(cmdptr(data, reply), DM_OK);
1364 }
1365 
1366 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_062, testing::ext::TestSize.Level0)
1367 {
1368     int32_t cmdCode = UPDATE_LOCALSERVICE_INFO;
1369     DMLocalServiceInfo serviceInfo;
1370     MessageParcel data;
1371     std::shared_ptr<IpcRegServiceInfoReq> req = std::make_shared<IpcRegServiceInfoReq>();
1372     req->SetLocalServiceInfo(serviceInfo);
1373 
1374     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1375     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1376     if (ptr) {
1377         ret = ptr(req, data);
1378     }
1379     ASSERT_EQ(DM_OK, ret);
1380 
1381     auto cmdptr = GetIpcCmdFunc(cmdCode);
1382     ASSERT_TRUE(cmdptr != nullptr);
1383     MessageParcel reply;
1384     EXPECT_EQ(cmdptr(data, reply), DM_OK);
1385 }
1386 
1387 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_063, testing::ext::TestSize.Level0)
1388 {
1389     int32_t cmdCode = GET_SERVICEINFO_BYBUNDLENAME_PINEXCHANGETYPE;
1390     DMLocalServiceInfo serviceInfo;
1391     MessageParcel data;
1392     std::shared_ptr<IpcCommonParamReq> req = std::make_shared<IpcCommonParamReq>();
1393     req->SetFirstParam(std::string("testbundle"));
1394     req->SetInt32Param(100);
1395 
1396     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1397     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1398     if (ptr) {
1399         ret = ptr(req, data);
1400     }
1401     ASSERT_EQ(DM_OK, ret);
1402 
1403     auto cmdptr = GetIpcCmdFunc(cmdCode);
1404     ASSERT_TRUE(cmdptr != nullptr);
1405     MessageParcel reply;
1406     EXPECT_EQ(cmdptr(data, reply), DM_OK);
1407 }
1408 
1409 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_016, testing::ext::TestSize.Level0)
1410 {
1411     int32_t cmdCode = SERVER_DEVICE_DISCOVERY;
1412     MessageParcel data;
1413     std::shared_ptr<IpcNotifyDeviceDiscoveryReq> pReq = std::make_shared<IpcNotifyDeviceDiscoveryReq>();
1414     std::string pkgName = "com.ohos.test";
1415     uint16_t subscribeId = 100;
1416     DmDeviceBasicInfo deviceBasicInfo;
1417     pReq->SetPkgName(pkgName);
1418     pReq->SetSubscribeId(subscribeId);
1419     pReq->SetDeviceBasicInfo(deviceBasicInfo);
1420     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1421     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1422     if (ptr) {
1423         ret = ptr(pReq, data);
1424     }
1425     ASSERT_EQ(DM_OK, ret);
1426 }
1427 
1428 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_017, testing::ext::TestSize.Level0)
1429 {
1430     int32_t cmdCode = SERVER_AUTH_RESULT;
1431     MessageParcel data;
1432     std::shared_ptr<IpcNotifyAuthResultReq> pReq = std::make_shared<IpcNotifyAuthResultReq>();
1433     std::string pkgName = "com.ohos.test";
1434     std::string deviceId = "112233445";
1435     std::string token = "134354656";
1436     int32_t status = 1;
1437     int32_t reason = 1;
1438     pReq->SetPkgName(pkgName);
1439     pReq->SetDeviceId(deviceId);
1440     pReq->SetToken(token);
1441     pReq->SetStatus(status);
1442     pReq->SetReason(reason);
1443     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1444     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1445     if (ptr) {
1446         ret = ptr(pReq, data);
1447     }
1448     ASSERT_EQ(DM_OK, ret);
1449 }
1450 
1451 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_018, testing::ext::TestSize.Level0)
1452 {
1453     int32_t cmdCode = SERVER_DEVICE_FA_NOTIFY;
1454     MessageParcel data;
1455     std::shared_ptr<IpcNotifyDMFAResultReq> pReq = std::make_shared<IpcNotifyDMFAResultReq>();
1456     std::string pkgName = "com.ohos.test";
1457     std::string paramJson = "{}";
1458     pReq->SetPkgName(pkgName);
1459     pReq->SetJsonParam(paramJson);
1460     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1461     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1462     if (ptr) {
1463         ret = ptr(pReq, data);
1464     }
1465     ASSERT_EQ(DM_OK, ret);
1466 }
1467 
1468 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_019, testing::ext::TestSize.Level0)
1469 {
1470     int32_t cmdCode = BIND_TARGET_RESULT;
1471     MessageParcel data;
1472     std::shared_ptr<IpcNotifyBindResultReq> pReq = std::make_shared<IpcNotifyBindResultReq>();
1473     std::string pkgName = "com.ohos.test";
1474     PeerTargetId targetId;
1475     int32_t result = 1;
1476     int32_t status = 1;
1477     std::string content = "";
1478     pReq->SetPkgName(pkgName);
1479     pReq->SetPeerTargetId(targetId);
1480     pReq->SetResult(result);
1481     pReq->SetStatus(status);
1482     pReq->SetContent(content);
1483     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1484     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1485     if (ptr) {
1486         ret = ptr(pReq, data);
1487     }
1488     ASSERT_EQ(DM_OK, ret);
1489 }
1490 
1491 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_020, testing::ext::TestSize.Level0)
1492 {
1493     int32_t cmdCode = UNBIND_TARGET_RESULT;
1494     MessageParcel data;
1495     std::shared_ptr<IpcNotifyBindResultReq> pReq = std::make_shared<IpcNotifyBindResultReq>();
1496     std::string pkgName = "com.ohos.test";
1497     PeerTargetId targetId;
1498     int32_t result = 1;
1499     std::string content = "";
1500     pReq->SetPkgName(pkgName);
1501     pReq->SetPeerTargetId(targetId);
1502     pReq->SetResult(result);
1503     pReq->SetContent(content);
1504     int ret = ERR_DM_UNSUPPORTED_IPC_COMMAND;
1505     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1506     if (ptr) {
1507         ret = ptr(pReq, data);
1508     }
1509     ASSERT_EQ(DM_OK, ret);
1510 }
1511 
1512 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_021, testing::ext::TestSize.Level0)
1513 {
1514     int32_t cmdCode = SERVER_ON_PIN_HOLDER_EVENT;
1515     MessageParcel data;
1516     std::shared_ptr<IpcReq> req = nullptr;
1517     int ret = ERR_DM_FAILED;
1518     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1519     if (ptr) {
1520         ret = ptr(req, data);
1521     }
1522     ASSERT_EQ(ret, ERR_DM_FAILED);
1523 
1524     req = std::make_shared<IpcNotifyPinHolderEventReq>();
1525     std::string pkgName = "com.ohos.test";
1526     req->SetPkgName(pkgName);
1527     if (ptr) {
1528         ret = ptr(req, data);
1529     }
1530     ASSERT_EQ(ret, DM_OK);
1531 }
1532 
1533 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_029, testing::ext::TestSize.Level0)
1534 {
1535     int32_t cmdCode = SERVER_ON_PIN_HOLDER_EVENT;
1536     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
1537 }
1538 
1539 HWTEST_F(IpcCmdParserServiceTest, OnIpcCmdFunc_055, testing::ext::TestSize.Level0)
1540 {
1541     int32_t cmdCode = CHECK_ACCESS_CONTROL;
1542     int32_t ret = DM_OK;
1543     MessageParcel data;
1544     MessageParcel reply;
1545     OnIpcCmdFunc ptr = GetIpcCmdFunc(cmdCode);
1546     if (ptr) {
1547         ret = ptr(data, reply);
1548     }
1549     ASSERT_EQ(ret, DM_OK);
1550 
1551     cmdCode = CHECK_SAME_ACCOUNT;
1552     OnIpcCmdFunc ptr1 = GetIpcCmdFunc(cmdCode);
1553     if (ptr1) {
1554         ret = ptr1(data, reply);
1555     }
1556     ASSERT_EQ(ret, DM_OK);
1557 
1558     cmdCode = SHIFT_LNN_GEAR;
1559     OnIpcCmdFunc ptr2 = GetIpcCmdFunc(cmdCode);
1560     if (ptr2) {
1561         ret = ptr2(data, reply);
1562     }
1563     ASSERT_EQ(ret, DM_OK);
1564 }
1565 
1566 HWTEST_F(IpcCmdParserServiceTest, SetIpcRequestFunc_022, testing::ext::TestSize.Level0)
1567 {
1568     int32_t cmdCode = SERVICE_CREDENTIAL_AUTH_STATUS_NOTIFY;
1569     MessageParcel data;
1570     std::shared_ptr<IpcNotifyCredentialAuthStatusReq> req = nullptr;
1571     int ret = ERR_DM_FAILED;
1572     SetIpcRequestFunc ptr = GetIpcRequestFunc(cmdCode);
1573     if (ptr) {
1574         ret = ptr(req, data);
1575     }
1576     ASSERT_EQ(ret, ERR_DM_FAILED);
1577 
1578     req = std::make_shared<IpcNotifyCredentialAuthStatusReq>();
1579     std::string pkgName = "com.ohos.test";
1580     std::string deviceList = "test";
1581     uint16_t deviceTypeId = 0x00;
1582     int32_t errcode = -1;
1583     req->SetPkgName(pkgName);
1584     req->SetDeviceList(deviceList);
1585     req->SetDeviceTypeId(deviceTypeId);
1586     req->SetErrCode(errcode);
1587     if (ptr) {
1588         ret = ptr(req, data);
1589     }
1590     ASSERT_EQ(ret, DM_OK);
1591 }
1592 
1593 HWTEST_F(IpcCmdParserServiceTest, ReadResponseFunc_030, testing::ext::TestSize.Level0)
1594 {
1595     int32_t cmdCode = SERVICE_CREDENTIAL_AUTH_STATUS_NOTIFY;
1596     ASSERT_EQ(ERR_DM_FAILED, TestReadResponseRspNull(cmdCode));
1597 }
1598 } // namespace
1599 } // namespace DistributedHardware
1600 } // namespace OHOS