Lines Matching refs:mock
196 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_normal() local
203 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
204 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
206 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_normal()
216 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
217 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
219 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_normal()
227 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
228 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
230 data = (struct ec_response_get_cmd_versions *)mock->o_data; in cros_ec_proto_test_query_all_normal()
238 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
239 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
241 data = (struct ec_response_get_cmd_versions *)mock->o_data; in cros_ec_proto_test_query_all_normal()
249 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
250 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
252 data = (struct ec_response_host_event_mask *)mock->o_data; in cros_ec_proto_test_query_all_normal()
262 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_normal()
263 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
265 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_normal()
266 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_normal()
267 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_normal()
269 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_normal()
280 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_normal()
281 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
283 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_normal()
284 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_normal()
287 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_normal()
289 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_normal()
298 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_normal()
299 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
301 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_normal()
302 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_normal()
303 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_normal()
305 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
307 data = (struct ec_params_get_cmd_versions *)mock->i_data; in cros_ec_proto_test_query_all_normal()
317 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_normal()
318 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
320 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_normal()
321 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_normal()
322 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_normal()
324 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
326 data = (struct ec_params_get_cmd_versions *)mock->i_data; in cros_ec_proto_test_query_all_normal()
334 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_normal()
335 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
337 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_normal()
338 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HOST_EVENT_GET_WAKE_MASK); in cros_ec_proto_test_query_all_normal()
339 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_host_event_mask)); in cros_ec_proto_test_query_all_normal()
340 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_normal()
350 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_no_pd_return_error() local
360 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_pd_return_error()
361 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return_error()
367 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_no_pd_return_error()
374 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_no_pd_return_error()
375 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return_error()
384 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_pd_return_error()
385 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return_error()
387 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_pd_return_error()
388 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_no_pd_return_error()
389 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_pd_return_error()
391 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_pd_return_error()
396 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_pd_return_error()
397 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return_error()
399 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_pd_return_error()
400 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_no_pd_return_error()
403 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_pd_return_error()
405 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_pd_return_error()
415 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_no_pd_return0() local
425 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_pd_return0()
426 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return0()
432 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_no_pd_return0()
439 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_no_pd_return0()
440 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return0()
449 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_pd_return0()
450 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return0()
452 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_pd_return0()
453 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_no_pd_return0()
454 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_pd_return0()
456 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_pd_return0()
461 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_pd_return0()
462 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_pd_return0()
464 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_pd_return0()
465 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_no_pd_return0()
468 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_pd_return0()
470 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_pd_return0()
480 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_legacy_normal_v3_return_error() local
485 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
486 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
493 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
494 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
496 data = (struct ec_response_hello *)mock->o_data; in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
506 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
507 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
509 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
510 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
511 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
513 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
520 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
521 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
523 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
524 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
525 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_hello)); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
526 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
528 data = (struct ec_params_hello *)mock->i_data; in cros_ec_proto_test_query_all_legacy_normal_v3_return_error()
545 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_legacy_normal_v3_return0() local
550 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
551 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
558 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
559 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
561 data = (struct ec_response_hello *)mock->o_data; in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
571 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
572 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
574 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
575 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
576 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
578 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
585 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
586 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
588 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
589 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
590 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_hello)); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
591 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
593 data = (struct ec_params_hello *)mock->i_data; in cros_ec_proto_test_query_all_legacy_normal_v3_return0()
610 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_legacy_xfer_error() local
615 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_legacy_xfer_error()
616 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_xfer_error()
621 mock = cros_kunit_ec_xfer_mock_addx(test, -EIO, EC_RES_SUCCESS, 0); in cros_ec_proto_test_query_all_legacy_xfer_error()
622 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_xfer_error()
632 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_xfer_error()
633 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_xfer_error()
635 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_xfer_error()
636 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_legacy_xfer_error()
637 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_legacy_xfer_error()
639 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_legacy_xfer_error()
644 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_xfer_error()
645 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_xfer_error()
647 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_xfer_error()
648 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_query_all_legacy_xfer_error()
649 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_hello)); in cros_ec_proto_test_query_all_legacy_xfer_error()
650 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_hello)); in cros_ec_proto_test_query_all_legacy_xfer_error()
658 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_legacy_return_error() local
663 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_legacy_return_error()
664 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return_error()
669 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_legacy_return_error()
670 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return_error()
680 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_return_error()
681 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return_error()
683 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_return_error()
684 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_legacy_return_error()
685 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_legacy_return_error()
687 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_legacy_return_error()
692 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_return_error()
693 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return_error()
695 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_return_error()
696 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_query_all_legacy_return_error()
697 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_hello)); in cros_ec_proto_test_query_all_legacy_return_error()
698 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_hello)); in cros_ec_proto_test_query_all_legacy_return_error()
706 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_legacy_data_error() local
711 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_legacy_data_error()
712 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_data_error()
719 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_legacy_data_error()
720 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_data_error()
722 data = (struct ec_response_hello *)mock->o_data; in cros_ec_proto_test_query_all_legacy_data_error()
733 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_data_error()
734 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_data_error()
736 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_data_error()
737 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_legacy_data_error()
738 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_legacy_data_error()
740 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_legacy_data_error()
745 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_data_error()
746 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_data_error()
748 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_data_error()
749 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_query_all_legacy_data_error()
750 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_hello)); in cros_ec_proto_test_query_all_legacy_data_error()
751 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_hello)); in cros_ec_proto_test_query_all_legacy_data_error()
759 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_legacy_return0() local
764 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_legacy_return0()
765 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return0()
770 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_legacy_return0()
771 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return0()
781 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_return0()
782 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return0()
784 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_return0()
785 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_legacy_return0()
786 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_legacy_return0()
788 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_legacy_return0()
793 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_legacy_return0()
794 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_legacy_return0()
796 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_legacy_return0()
797 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_query_all_legacy_return0()
798 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_hello)); in cros_ec_proto_test_query_all_legacy_return0()
799 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_hello)); in cros_ec_proto_test_query_all_legacy_return0()
807 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_no_mkbp() local
817 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_mkbp()
818 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp()
824 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_no_mkbp()
831 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_no_mkbp()
832 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp()
839 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_mkbp()
840 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp()
842 data = (struct ec_response_get_cmd_versions *)mock->o_data; in cros_ec_proto_test_query_all_no_mkbp()
852 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp()
853 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp()
855 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp()
856 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_no_mkbp()
857 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp()
859 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_mkbp()
864 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp()
865 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp()
867 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp()
868 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_no_mkbp()
871 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp()
873 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_mkbp()
880 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp()
881 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp()
883 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp()
884 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_no_mkbp()
885 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp()
887 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_query_all_no_mkbp()
889 data = (struct ec_params_get_cmd_versions *)mock->i_data; in cros_ec_proto_test_query_all_no_mkbp()
900 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_no_mkbp_return_error() local
910 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_mkbp_return_error()
911 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return_error()
917 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_no_mkbp_return_error()
924 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_no_mkbp_return_error()
925 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return_error()
930 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_no_mkbp_return_error()
931 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return_error()
940 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp_return_error()
941 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return_error()
943 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp_return_error()
944 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_no_mkbp_return_error()
945 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp_return_error()
947 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_mkbp_return_error()
952 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp_return_error()
953 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return_error()
955 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp_return_error()
956 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_no_mkbp_return_error()
959 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp_return_error()
961 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_mkbp_return_error()
968 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp_return_error()
969 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return_error()
971 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp_return_error()
972 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_no_mkbp_return_error()
973 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp_return_error()
975 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_query_all_no_mkbp_return_error()
977 data = (struct ec_params_get_cmd_versions *)mock->i_data; in cros_ec_proto_test_query_all_no_mkbp_return_error()
988 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_no_mkbp_return0() local
998 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_mkbp_return0()
999 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return0()
1005 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_no_mkbp_return0()
1012 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_no_mkbp_return0()
1013 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return0()
1018 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_no_mkbp_return0()
1019 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return0()
1028 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp_return0()
1029 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return0()
1031 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp_return0()
1032 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_no_mkbp_return0()
1033 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp_return0()
1035 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_mkbp_return0()
1040 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp_return0()
1041 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return0()
1043 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp_return0()
1044 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_no_mkbp_return0()
1047 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp_return0()
1049 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_mkbp_return0()
1056 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_mkbp_return0()
1057 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_mkbp_return0()
1059 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_mkbp_return0()
1060 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_no_mkbp_return0()
1061 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_mkbp_return0()
1063 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_query_all_no_mkbp_return0()
1065 data = (struct ec_params_get_cmd_versions *)mock->i_data; in cros_ec_proto_test_query_all_no_mkbp_return0()
1076 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_no_host_sleep() local
1086 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_host_sleep()
1087 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1093 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_no_host_sleep()
1100 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1101 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1106 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1107 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1114 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_host_sleep()
1115 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1117 data = (struct ec_response_get_cmd_versions *)mock->o_data; in cros_ec_proto_test_query_all_no_host_sleep()
1127 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep()
1128 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1130 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1131 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_no_host_sleep()
1132 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep()
1134 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1139 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep()
1140 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1142 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1143 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_no_host_sleep()
1146 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep()
1148 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1153 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep()
1154 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1156 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1157 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_no_host_sleep()
1158 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep()
1160 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_no_host_sleep()
1165 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep()
1166 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep()
1168 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep()
1169 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_no_host_sleep()
1170 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep()
1172 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_no_host_sleep()
1182 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_no_host_sleep_return0() local
1192 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1193 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1199 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_no_host_sleep_return0()
1206 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1207 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1214 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1215 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1218 data = (struct ec_response_get_cmd_versions *)mock->o_data; in cros_ec_proto_test_query_all_no_host_sleep_return0()
1224 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1225 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1234 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1235 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1237 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1238 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1239 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep_return0()
1241 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1246 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1247 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1249 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1250 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_no_host_sleep_return0()
1253 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep_return0()
1255 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1260 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1261 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1263 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1264 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1265 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep_return0()
1267 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1272 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1273 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1275 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1276 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1277 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_no_host_sleep_return0()
1279 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_no_host_sleep_return0()
1289 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_default_wake_mask_return_error() local
1299 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1300 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1306 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1313 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1314 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1319 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1320 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1325 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1326 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1331 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1332 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1341 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1342 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1344 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1345 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1346 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1348 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1353 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1354 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1356 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1357 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1360 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1362 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1367 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1368 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1370 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1371 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1372 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1374 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1379 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1380 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1382 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1383 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1384 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1386 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1393 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1394 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1396 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1397 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HOST_EVENT_GET_WAKE_MASK); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1398 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_host_event_mask)); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1399 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_default_wake_mask_return_error()
1416 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_default_wake_mask_return0() local
1426 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1427 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1433 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_default_wake_mask_return0()
1440 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1441 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1446 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1447 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1452 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1453 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1458 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1459 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1468 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1469 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1471 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1472 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_PROTOCOL_INFO); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1473 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return0()
1475 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1480 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1481 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1483 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1484 KUNIT_EXPECT_EQ(test, mock->msg.command, in cros_ec_proto_test_query_all_default_wake_mask_return0()
1487 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return0()
1489 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1494 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1495 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1497 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1498 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1499 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return0()
1501 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1506 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1507 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1509 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1510 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_CMD_VERSIONS); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1511 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_query_all_default_wake_mask_return0()
1513 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(struct ec_params_get_cmd_versions)); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1520 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1521 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1523 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1524 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HOST_EVENT_GET_WAKE_MASK); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1525 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_host_event_mask)); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1526 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_query_all_default_wake_mask_return0()
1543 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_normal() local
1564 mock = cros_kunit_ec_xfer_mock_add(test, 4); in cros_ec_proto_test_cmd_xfer_normal()
1565 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_normal()
1567 data = (u8 *)mock->o_data; in cros_ec_proto_test_cmd_xfer_normal()
1580 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_cmd_xfer_normal()
1581 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_normal()
1583 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_cmd_xfer_normal()
1584 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_cmd_xfer_normal()
1585 KUNIT_EXPECT_EQ(test, mock->msg.insize, 4); in cros_ec_proto_test_cmd_xfer_normal()
1586 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 2); in cros_ec_proto_test_cmd_xfer_normal()
1588 data = (u8 *)mock->i_data; in cros_ec_proto_test_cmd_xfer_normal()
1603 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_excess_msg_insize() local
1620 mock = cros_kunit_ec_xfer_mock_add(test, 0xcc); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1621 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1628 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1629 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1631 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1632 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_HELLO); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1633 KUNIT_EXPECT_EQ(test, mock->msg.insize, 0xee); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1634 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 2); in cros_ec_proto_test_cmd_xfer_excess_msg_insize()
1762 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_in_progress_normal() local
1772 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1773 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1780 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1781 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1783 data = (struct ec_response_get_comms_status *)mock->o_data; in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1794 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1795 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1800 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1801 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1803 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1804 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_COMMS_STATUS); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1805 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1807 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_cmd_xfer_in_progress_normal()
1817 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_in_progress_retries_eagain() local
1827 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0); in cros_ec_proto_test_cmd_xfer_in_progress_retries_eagain()
1828 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_retries_eagain()
1845 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing() local
1855 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0); in cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing()
1856 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing()
1865 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing()
1866 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing()
1868 data = (struct ec_response_get_comms_status *)mock->o_data; in cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing()
1884 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_in_progress_xfer_error() local
1892 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0); in cros_ec_proto_test_cmd_xfer_in_progress_xfer_error()
1893 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_xfer_error()
1898 mock = cros_kunit_ec_xfer_mock_addx(test, -EIO, EC_RES_SUCCESS, 0); in cros_ec_proto_test_cmd_xfer_in_progress_xfer_error()
1899 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_xfer_error()
1910 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_in_progress_return_error() local
1920 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0); in cros_ec_proto_test_cmd_xfer_in_progress_return_error()
1921 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_return_error()
1926 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0); in cros_ec_proto_test_cmd_xfer_in_progress_return_error()
1927 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_return_error()
1942 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_in_progress_return0() local
1952 mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0); in cros_ec_proto_test_cmd_xfer_in_progress_return0()
1953 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_return0()
1958 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_cmd_xfer_in_progress_return0()
1959 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_in_progress_return0()
1972 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_status_normal() local
1980 mock = cros_kunit_ec_xfer_mock_add(test, 0); in cros_ec_proto_test_cmd_xfer_status_normal()
1981 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_status_normal()
1992 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_status_xfer_error() local
2000 mock = cros_kunit_ec_xfer_mock_addx(test, -EPROTO, EC_RES_SUCCESS, 0); in cros_ec_proto_test_cmd_xfer_status_xfer_error()
2001 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_status_xfer_error()
2012 struct ec_xfer_mock *mock; in cros_ec_proto_test_cmd_xfer_status_return_error() local
2048 mock = cros_kunit_ec_xfer_mock_addx(test, 0, i, 0); in cros_ec_proto_test_cmd_xfer_status_return_error()
2049 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_cmd_xfer_status_return_error()
2060 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_next_event_no_mkbp_event() local
2076 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2077 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2079 data = (union ec_response_get_next_data_v1 *)mock->o_data; in cros_ec_proto_test_get_next_event_no_mkbp_event()
2094 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2095 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2097 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2098 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MKBP_STATE); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2099 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(union ec_response_get_next_data_v1)); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2100 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_get_next_event_no_mkbp_event()
2121 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_next_event_mkbp_event_version0() local
2137 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2138 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2140 data = (struct ec_response_get_next_event *)mock->o_data; in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2156 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2157 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2159 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2160 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_NEXT_EVENT); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2161 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_get_next_event)); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2162 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_get_next_event_mkbp_event_version0()
2170 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_next_event_mkbp_event_version2() local
2186 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2187 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2189 data = (struct ec_response_get_next_event_v1 *)mock->o_data; in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2205 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2206 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2208 KUNIT_EXPECT_EQ(test, mock->msg.version, 2); in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2209 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_NEXT_EVENT); in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2210 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2212 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_get_next_event_mkbp_event_version2()
2220 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc() local
2235 mock = cros_kunit_ec_xfer_mock_add(test, in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2238 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2240 data = (struct ec_response_get_next_event_v1 *)mock->o_data; in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2254 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2255 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2257 KUNIT_EXPECT_EQ(test, mock->msg.version, 2); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2258 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_NEXT_EVENT); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2259 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2261 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_rtc()
2269 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked() local
2284 mock = cros_kunit_ec_xfer_mock_add(test, in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2287 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2289 data = (struct ec_response_get_next_event_v1 *)mock->o_data; in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2304 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2305 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2307 KUNIT_EXPECT_EQ(test, mock->msg.version, 2); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2308 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_NEXT_EVENT); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2309 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2311 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_get_next_event_mkbp_event_host_event_masked()
2396 struct ec_xfer_mock *mock; in cros_ec_proto_test_check_features_not_cached() local
2412 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_check_features_not_cached()
2413 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_check_features_not_cached()
2415 data = (struct ec_response_get_features *)mock->o_data; in cros_ec_proto_test_check_features_not_cached()
2435 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_check_features_not_cached()
2436 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_check_features_not_cached()
2438 KUNIT_EXPECT_EQ(test, mock->msg.version, 0); in cros_ec_proto_test_check_features_not_cached()
2439 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_FEATURES); in cros_ec_proto_test_check_features_not_cached()
2440 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_get_features)); in cros_ec_proto_test_check_features_not_cached()
2441 KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0); in cros_ec_proto_test_check_features_not_cached()
2449 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_sensor_count_normal() local
2463 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_get_sensor_count_normal()
2464 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_sensor_count_normal()
2466 data = (struct ec_response_motion_sense *)mock->o_data; in cros_ec_proto_test_get_sensor_count_normal()
2477 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_sensor_count_normal()
2478 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_sensor_count_normal()
2480 KUNIT_EXPECT_EQ(test, mock->msg.version, 1); in cros_ec_proto_test_get_sensor_count_normal()
2481 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MOTION_SENSE_CMD); in cros_ec_proto_test_get_sensor_count_normal()
2482 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_motion_sense)); in cros_ec_proto_test_get_sensor_count_normal()
2483 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_get_sensor_count_normal()
2485 data = (struct ec_params_motion_sense *)mock->i_data; in cros_ec_proto_test_get_sensor_count_normal()
2494 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_sensor_count_xfer_error() local
2506 mock = cros_kunit_ec_xfer_mock_addx(test, -EPROTO, EC_RES_SUCCESS, 0); in cros_ec_proto_test_get_sensor_count_xfer_error()
2507 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_sensor_count_xfer_error()
2517 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_sensor_count_xfer_error()
2518 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_sensor_count_xfer_error()
2520 KUNIT_EXPECT_EQ(test, mock->msg.version, 1); in cros_ec_proto_test_get_sensor_count_xfer_error()
2521 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MOTION_SENSE_CMD); in cros_ec_proto_test_get_sensor_count_xfer_error()
2522 KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(struct ec_response_motion_sense)); in cros_ec_proto_test_get_sensor_count_xfer_error()
2523 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_get_sensor_count_xfer_error()
2525 data = (struct ec_params_motion_sense *)mock->i_data; in cros_ec_proto_test_get_sensor_count_xfer_error()
2534 struct ec_xfer_mock *mock; in cros_ec_proto_test_get_sensor_count_legacy() local
2555 mock = cros_kunit_ec_xfer_mock_addx(test, -EPROTO, EC_RES_SUCCESS, 0); in cros_ec_proto_test_get_sensor_count_legacy()
2556 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_sensor_count_legacy()
2575 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_get_sensor_count_legacy()
2576 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_get_sensor_count_legacy()
2578 KUNIT_EXPECT_EQ(test, mock->msg.version, 1); in cros_ec_proto_test_get_sensor_count_legacy()
2579 KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MOTION_SENSE_CMD); in cros_ec_proto_test_get_sensor_count_legacy()
2580 KUNIT_EXPECT_EQ(test, mock->msg.insize, in cros_ec_proto_test_get_sensor_count_legacy()
2582 KUNIT_EXPECT_EQ(test, mock->msg.outsize, sizeof(*data)); in cros_ec_proto_test_get_sensor_count_legacy()
2584 data = (struct ec_params_motion_sense *)mock->i_data; in cros_ec_proto_test_get_sensor_count_legacy()
2599 struct ec_xfer_mock *mock; in cros_ec_proto_test_ec_cmd() local
2613 mock = cros_kunit_ec_xfer_mock_add(test, 2); in cros_ec_proto_test_ec_cmd()
2614 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_ec_cmd()
2616 data = (u8 *)mock->o_data; in cros_ec_proto_test_ec_cmd()
2627 mock = cros_kunit_ec_xfer_mock_next(); in cros_ec_proto_test_ec_cmd()
2628 KUNIT_EXPECT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_ec_cmd()
2630 KUNIT_EXPECT_EQ(test, mock->msg.version, 0x88); in cros_ec_proto_test_ec_cmd()
2631 KUNIT_EXPECT_EQ(test, mock->msg.command, 0x77); in cros_ec_proto_test_ec_cmd()
2632 KUNIT_EXPECT_EQ(test, mock->msg.insize, ARRAY_SIZE(in)); in cros_ec_proto_test_ec_cmd()
2633 KUNIT_EXPECT_EQ(test, mock->msg.outsize, ARRAY_SIZE(out)); in cros_ec_proto_test_ec_cmd()
2635 data = (u8 *)mock->i_data; in cros_ec_proto_test_ec_cmd()