* [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3
@ 2024-06-11 3:31 Tzung-Bi Shih
2024-06-11 16:39 ` Guenter Roeck
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tzung-Bi Shih @ 2024-06-11 3:31 UTC (permalink / raw)
To: bleung, groeck; +Cc: tzungbi, chrome-platform
Since commit 106d67398233 ("platform/chrome: cros_ec_proto: Upgrade
get_next_event to v3"), (struct cros_ec_device *)->event_data becomes
struct ec_response_get_next_event_v3.
Update the Kunit test for fixing the following error:
> Expected mock->msg.insize == sizeof(union ec_response_get_next_data_v1), but
> mock->msg.insize == 18 (0x12)
> sizeof(union ec_response_get_next_data_v1) == 16 (0x10)
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
drivers/platform/chrome/cros_ec_proto_test.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/chrome/cros_ec_proto_test.c b/drivers/platform/chrome/cros_ec_proto_test.c
index 3960f7c16eb0..7ca9895a0065 100644
--- a/drivers/platform/chrome/cros_ec_proto_test.c
+++ b/drivers/platform/chrome/cros_ec_proto_test.c
@@ -2060,17 +2060,17 @@ static void cros_ec_proto_test_get_next_event_no_mkbp_event(struct kunit *test)
/* For get_keyboard_state_event(). */
{
- union ec_response_get_next_data_v1 *data;
+ union ec_response_get_next_data_v3 *data;
mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data));
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
- data = (union ec_response_get_next_data_v1 *)mock->o_data;
+ data = (union ec_response_get_next_data_v3 *)mock->o_data;
data->host_event = 0xbeef;
}
ret = cros_ec_get_next_event(ec_dev, &wake_event, &more_events);
- KUNIT_EXPECT_EQ(test, ret, sizeof(union ec_response_get_next_data_v1));
+ KUNIT_EXPECT_EQ(test, ret, sizeof(union ec_response_get_next_data_v3));
KUNIT_EXPECT_EQ(test, ec_dev->event_data.event_type, EC_MKBP_EVENT_KEY_MATRIX);
KUNIT_EXPECT_EQ(test, ec_dev->event_data.data.host_event, 0xbeef);
@@ -2085,7 +2085,7 @@ static void cros_ec_proto_test_get_next_event_no_mkbp_event(struct kunit *test)
KUNIT_EXPECT_EQ(test, mock->msg.version, 0);
KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MKBP_STATE);
- KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(union ec_response_get_next_data_v1));
+ KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(union ec_response_get_next_data_v3));
KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
}
}
--
2.45.2.505.gda0bf45e8d-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3
2024-06-11 3:31 [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3 Tzung-Bi Shih
@ 2024-06-11 16:39 ` Guenter Roeck
2024-06-12 2:30 ` patchwork-bot+chrome-platform
2024-06-12 2:30 ` patchwork-bot+chrome-platform
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2024-06-11 16:39 UTC (permalink / raw)
To: Tzung-Bi Shih; +Cc: bleung, groeck, chrome-platform
On Mon, Jun 10, 2024 at 8:31 PM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
>
> Since commit 106d67398233 ("platform/chrome: cros_ec_proto: Upgrade
> get_next_event to v3"), (struct cros_ec_device *)->event_data becomes
> struct ec_response_get_next_event_v3.
>
> Update the Kunit test for fixing the following error:
> > Expected mock->msg.insize == sizeof(union ec_response_get_next_data_v1), but
> > mock->msg.insize == 18 (0x12)
> > sizeof(union ec_response_get_next_data_v1) == 16 (0x10)
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
> drivers/platform/chrome/cros_ec_proto_test.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec_proto_test.c b/drivers/platform/chrome/cros_ec_proto_test.c
> index 3960f7c16eb0..7ca9895a0065 100644
> --- a/drivers/platform/chrome/cros_ec_proto_test.c
> +++ b/drivers/platform/chrome/cros_ec_proto_test.c
> @@ -2060,17 +2060,17 @@ static void cros_ec_proto_test_get_next_event_no_mkbp_event(struct kunit *test)
>
> /* For get_keyboard_state_event(). */
> {
> - union ec_response_get_next_data_v1 *data;
> + union ec_response_get_next_data_v3 *data;
>
> mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data));
> KUNIT_ASSERT_PTR_NE(test, mock, NULL);
>
> - data = (union ec_response_get_next_data_v1 *)mock->o_data;
> + data = (union ec_response_get_next_data_v3 *)mock->o_data;
> data->host_event = 0xbeef;
> }
>
> ret = cros_ec_get_next_event(ec_dev, &wake_event, &more_events);
> - KUNIT_EXPECT_EQ(test, ret, sizeof(union ec_response_get_next_data_v1));
> + KUNIT_EXPECT_EQ(test, ret, sizeof(union ec_response_get_next_data_v3));
>
> KUNIT_EXPECT_EQ(test, ec_dev->event_data.event_type, EC_MKBP_EVENT_KEY_MATRIX);
> KUNIT_EXPECT_EQ(test, ec_dev->event_data.data.host_event, 0xbeef);
> @@ -2085,7 +2085,7 @@ static void cros_ec_proto_test_get_next_event_no_mkbp_event(struct kunit *test)
>
> KUNIT_EXPECT_EQ(test, mock->msg.version, 0);
> KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_MKBP_STATE);
> - KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(union ec_response_get_next_data_v1));
> + KUNIT_EXPECT_EQ(test, mock->msg.insize, sizeof(union ec_response_get_next_data_v3));
> KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
> }
> }
> --
> 2.45.2.505.gda0bf45e8d-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3
2024-06-11 3:31 [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3 Tzung-Bi Shih
2024-06-11 16:39 ` Guenter Roeck
@ 2024-06-12 2:30 ` patchwork-bot+chrome-platform
2024-06-12 2:30 ` patchwork-bot+chrome-platform
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+chrome-platform @ 2024-06-12 2:30 UTC (permalink / raw)
To: Tzung-Bi Shih; +Cc: bleung, groeck, chrome-platform
Hello:
This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:
On Tue, 11 Jun 2024 03:31:13 +0000 you wrote:
> Since commit 106d67398233 ("platform/chrome: cros_ec_proto: Upgrade
> get_next_event to v3"), (struct cros_ec_device *)->event_data becomes
> struct ec_response_get_next_event_v3.
>
> Update the Kunit test for fixing the following error:
> > Expected mock->msg.insize == sizeof(union ec_response_get_next_data_v1), but
> > mock->msg.insize == 18 (0x12)
> > sizeof(union ec_response_get_next_data_v1) == 16 (0x10)
>
> [...]
Here is the summary with links:
- platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3
https://git.kernel.org/chrome-platform/c/41f1242f6249
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3
2024-06-11 3:31 [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3 Tzung-Bi Shih
2024-06-11 16:39 ` Guenter Roeck
2024-06-12 2:30 ` patchwork-bot+chrome-platform
@ 2024-06-12 2:30 ` patchwork-bot+chrome-platform
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+chrome-platform @ 2024-06-12 2:30 UTC (permalink / raw)
To: Tzung-Bi Shih; +Cc: bleung, groeck, chrome-platform
Hello:
This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:
On Tue, 11 Jun 2024 03:31:13 +0000 you wrote:
> Since commit 106d67398233 ("platform/chrome: cros_ec_proto: Upgrade
> get_next_event to v3"), (struct cros_ec_device *)->event_data becomes
> struct ec_response_get_next_event_v3.
>
> Update the Kunit test for fixing the following error:
> > Expected mock->msg.insize == sizeof(union ec_response_get_next_data_v1), but
> > mock->msg.insize == 18 (0x12)
> > sizeof(union ec_response_get_next_data_v1) == 16 (0x10)
>
> [...]
Here is the summary with links:
- platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3
https://git.kernel.org/chrome-platform/c/41f1242f6249
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-12 2:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-11 3:31 [PATCH] platform/chrome: cros_ec_proto: update Kunit test for get_next_data_v3 Tzung-Bi Shih
2024-06-11 16:39 ` Guenter Roeck
2024-06-12 2:30 ` patchwork-bot+chrome-platform
2024-06-12 2:30 ` patchwork-bot+chrome-platform
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox