summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Massey <aaronmassey@google.com>2022-02-14 17:27:04 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-16 05:37:36 +0000
commitd97ef85d58a5fb40f2a96e8524de658f13382d69 (patch)
tree1a5fa41f9080b7445d5e6e92c4e4497322583852
parent1ef9959bba04d0da99a37b7e9b32888a79c2ba5a (diff)
downloadchrome-ec-d97ef85d58a5fb40f2a96e8524de658f13382d69.tar.gz
zephyr: test: Verify invoke typec status host cmd
To facilitate assertion failure isolation, add a test verifying only that the typec status host command can be successfully invoked. BRANCH=none BUG=b:189954415 TEST=zmake configure --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I685144a6c123b24b6931783f1e0f8afc7408fd4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3462646 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/test/drivers/src/espi.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/zephyr/test/drivers/src/espi.c b/zephyr/test/drivers/src/espi.c
index 1a476aab72..5b89ebdf10 100644
--- a/zephyr/test/drivers/src/espi.c
+++ b/zephyr/test/drivers/src/espi.c
@@ -36,8 +36,8 @@ ZTEST_USER(espi, test_host_command_usb_pd_power_info)
/* Only test we've enabled the command */
struct ec_response_usb_pd_power_info response;
struct ec_params_usb_pd_power_info params = { .port = PORT };
- struct host_cmd_handler_args args = BUILD_HOST_COMMAND_RESPONSE(
- EC_CMD_USB_PD_POWER_INFO, 0, response);
+ struct host_cmd_handler_args args = BUILD_HOST_COMMAND(
+ EC_CMD_USB_PD_POWER_INFO, 0, response, params);
args.params = &params;
zassert_ok(host_command_process(&args), NULL);
@@ -45,4 +45,17 @@ ZTEST_USER(espi, test_host_command_usb_pd_power_info)
zassert_equal(args.response_size, sizeof(response), NULL);
}
+ZTEST_USER(espi, test_host_command_typec_status)
+{
+ /* Only test we've enabled the command */
+ struct ec_params_typec_status params = { .port = PORT };
+ struct ec_response_typec_status response;
+ struct host_cmd_handler_args args =
+ BUILD_HOST_COMMAND(EC_CMD_TYPEC_STATUS, 0, response, params);
+
+ zassert_ok(host_command_process(&args), NULL);
+ zassert_ok(args.result, NULL);
+ zassert_equal(args.response_size, sizeof(response), NULL);
+}
+
ZTEST_SUITE(espi, drivers_predicate_post_main, NULL, NULL, NULL, NULL);