diff options
-rw-r--r-- | zephyr/test/drivers/default/src/console_cmd/hostevent.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/zephyr/test/drivers/default/src/console_cmd/hostevent.c b/zephyr/test/drivers/default/src/console_cmd/hostevent.c index f8da417cc0..bcce2ff568 100644 --- a/zephyr/test/drivers/default/src/console_cmd/hostevent.c +++ b/zephyr/test/drivers/default/src/console_cmd/hostevent.c @@ -44,6 +44,22 @@ ZTEST_USER(console_cmd_hostevent, test_hostevent) "Failed default print"); } +/* hostevent with invalid arguments */ +ZTEST_USER(console_cmd_hostevent, test_hostevent_invalid) +{ + int rv; + + /* Test invalid sub-command */ + rv = shell_execute_cmd(get_ec_shell(), "hostevent invalid 0xFFFF"); + zassert_equal(rv, EC_ERROR_PARAM1, "Expected %d, but got %d", + EC_ERROR_PARAM1, rv); + + /* Test invalid mask */ + rv = shell_execute_cmd(get_ec_shell(), "hostevent set invalid-mask"); + zassert_equal(rv, EC_ERROR_PARAM2, "Expected %d, but got %d", + EC_ERROR_PARAM2, rv); +} + ZTEST_SUITE(console_cmd_hostevent, drivers_predicate_post_main, console_cmd_hostevent_setup, console_cmd_hostevent_before, console_cmd_hostevent_after, NULL); |