diff options
Diffstat (limited to 'zephyr/test/drivers/default')
5 files changed, 15 insertions, 54 deletions
diff --git a/zephyr/test/drivers/default/src/console_cmd/CMakeLists.txt b/zephyr/test/drivers/default/src/console_cmd/CMakeLists.txt index 7fdabd1c52..b4ed741430 100644 --- a/zephyr/test/drivers/default/src/console_cmd/CMakeLists.txt +++ b/zephyr/test/drivers/default/src/console_cmd/CMakeLists.txt @@ -18,7 +18,6 @@ target_sources(app PRIVATE accelread.c accelres.c button.c - crash.c cutoff.c ec_features.c gpio.c diff --git a/zephyr/test/drivers/default/src/console_cmd/crash.c b/zephyr/test/drivers/default/src/console_cmd/crash.c deleted file mode 100644 index 4218aa74d6..0000000000 --- a/zephyr/test/drivers/default/src/console_cmd/crash.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2022 The ChromiumOS Authors - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "builtin/assert.h" -#include "console.h" -#include "test/drivers/test_mocks.h" -#include "test/drivers/test_state.h" - -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - -ZTEST_SUITE(console_cmd_crash, drivers_predicate_post_main, NULL, NULL, NULL, - NULL); - -ZTEST_USER(console_cmd_crash, test_wrong_num_args) -{ - int rv = shell_execute_cmd(get_ec_shell(), "crash"); - - zassert_equal(EC_ERROR_PARAM1, rv, "Expected %d, but got %d", - EC_ERROR_PARAM1, rv); -} - -ZTEST_USER(console_cmd_crash, test_assert) -{ - int rv; - - RESET_FAKE(assert_post_action); - rv = shell_execute_cmd(get_ec_shell(), "crash assert"); - - zassert_equal(EC_ERROR_UNKNOWN, rv, NULL); - zassert_equal(1, assert_post_action_fake.call_count, NULL); -} diff --git a/zephyr/test/drivers/default/src/espi.c b/zephyr/test/drivers/default/src/espi.c index e526980ef1..d81718d422 100644 --- a/zephyr/test/drivers/default/src/espi.c +++ b/zephyr/test/drivers/default/src/espi.c @@ -77,25 +77,6 @@ ZTEST_USER(espi, test_host_command_typec_status) zassert_equal(args.response_size, sizeof(response)); } -ZTEST_USER(espi, test_host_command_usb_pd_get_amode) -{ - /* Only test we've enabled the command */ - struct ec_params_usb_pd_get_mode_request params = { - .port = PORT, - .svid_idx = 0, - }; - struct ec_params_usb_pd_get_mode_response response; - struct host_cmd_handler_args args = BUILD_HOST_COMMAND( - EC_CMD_USB_PD_GET_AMODE, 0, response, params); - - zassert_ok(host_command_process(&args)); - zassert_ok(args.result); - /* Note: with no SVIDs the response size is the size of the svid field. - * See the usb alt mode test for verifying larger struct sizes - */ - zassert_equal(args.response_size, sizeof(response.svid)); -} - ZTEST_USER(espi, test_host_command_gpio_get_v0) { struct ec_params_gpio_get p = { diff --git a/zephyr/test/drivers/default/src/integration/usbc/usb_pd_ctrl_msg.c b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_ctrl_msg.c index 1d3da4921f..0e5d3eecad 100644 --- a/zephyr/test/drivers/default/src/integration/usbc/usb_pd_ctrl_msg.c +++ b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_ctrl_msg.c @@ -213,6 +213,9 @@ ZTEST_F(usb_pd_ctrl_msg_test_sink, verify_pr_swap) snk_resp = host_cmd_typec_status(TEST_USB_PORT); zassert_equal(PD_ROLE_SOURCE, snk_resp.power_role, "SNK Returned power_role=%u", snk_resp.power_role); + + tcpci_partner_common_handler_mask_msg(&super_fixture->partner_emul, + PD_CTRL_ACCEPT, false); } /** diff --git a/zephyr/test/drivers/default/src/isl923x.c b/zephyr/test/drivers/default/src/isl923x.c index 1393466c76..8dbfdf530b 100644 --- a/zephyr/test/drivers/default/src/isl923x.c +++ b/zephyr/test/drivers/default/src/isl923x.c @@ -720,6 +720,18 @@ ZTEST(isl923x, test_isl923x_is_acok) rv = raa489000_is_acok(CHARGER_NUM, &acok); zassert_equal(EC_SUCCESS, rv, "AC OK check did not return success"); zassert_false(acok, "AC OK is true"); + + /* + * Charger is sourcing - ACOK is always false, + * even if the pin is asserted. + */ + raa489000_emul_set_acok_pin(isl923x_emul, 1); + raa489000_emul_set_state_machine_state(isl923x_emul, + RAA489000_INFO2_STATE_OTG); + + rv = raa489000_is_acok(CHARGER_NUM, &acok); + zassert_equal(EC_SUCCESS, rv, "AC OK check did not return success"); + zassert_false(acok, "ACOK is true when sourcing, expected false"); } ZTEST(isl923x, test_isl923x_enable_asgate) |