From 0ee5a8129d31a25e83803200b36988a3cda2f99a Mon Sep 17 00:00:00 2001 From: Jeremy Bettis Date: Thu, 6 Oct 2022 15:33:56 -0600 Subject: ec: Remove all zassume usages Since zassume is being used in scenarios where no one would use ztest_test_skip(), convert all zassumes to zasserts. BRANCH=None BUG=b:256650891 TEST=./twister Signed-off-by: Jeremy Bettis Change-Id: I1dc806e25f64f8dbef6f7d10cfe2f46ea4887e61 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3937539 Code-Coverage: Zoss Auto-Submit: Jeremy Bettis Tested-by: Jeremy Bettis Reviewed-by: Simon Glass Reviewed-by: Aaron Massey Commit-Queue: Jeremy Bettis Commit-Queue: Aaron Massey --- zephyr/test/drivers/host_cmd/src/get_pd_port_caps.c | 2 +- zephyr/test/drivers/host_cmd/src/motion_sense.c | 8 ++++---- zephyr/test/drivers/host_cmd/src/pd_chip_info.c | 4 ++-- zephyr/test/drivers/host_cmd/src/pd_control.c | 8 ++++---- zephyr/test/drivers/host_cmd/src/usb_pd_control.c | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'zephyr/test/drivers/host_cmd') diff --git a/zephyr/test/drivers/host_cmd/src/get_pd_port_caps.c b/zephyr/test/drivers/host_cmd/src/get_pd_port_caps.c index 907329f8a1..721fbcd8f9 100644 --- a/zephyr/test/drivers/host_cmd/src/get_pd_port_caps.c +++ b/zephyr/test/drivers/host_cmd/src/get_pd_port_caps.c @@ -50,7 +50,7 @@ static void host_cmd_get_pd_port_caps_begin(void *data) ARG_UNUSED(data); /* Assume we have at least one USB-C port */ - zassume_true(board_get_usb_pd_port_count() > 0, + zassert_true(board_get_usb_pd_port_count() > 0, "Insufficient TCPCs found"); } diff --git a/zephyr/test/drivers/host_cmd/src/motion_sense.c b/zephyr/test/drivers/host_cmd/src/motion_sense.c index 371ca4ae11..1b35eb637c 100644 --- a/zephyr/test/drivers/host_cmd/src/motion_sense.c +++ b/zephyr/test/drivers/host_cmd/src/motion_sense.c @@ -72,7 +72,7 @@ static void host_cmd_motion_sense_before(void *fixture) RESET_FAKE(mock_perform_calib); FFF_RESET_HISTORY(); - zassume_ok(shell_execute_cmd(get_ec_shell(), "accelinit 0")); + zassert_ok(shell_execute_cmd(get_ec_shell(), "accelinit 0")); atomic_clear(&motion_sensors[0].flush_pending); motion_sensors[0].config[SENSOR_CONFIG_AP].odr = 0; @@ -305,7 +305,7 @@ ZTEST_USER(host_cmd_motion_sense, test_odr_get) { struct ec_response_motion_sense response; - zassume_ok(motion_sensors[0].drv->set_data_rate(&motion_sensors[0], + zassert_ok(motion_sensors[0].drv->set_data_rate(&motion_sensors[0], 1000000, false), NULL); zassert_ok(host_cmd_motion_sense_odr(/*sensor_num=*/0, @@ -322,7 +322,7 @@ ZTEST_USER(host_cmd_motion_sense, test_odr_set) { struct ec_response_motion_sense response; - zassume_ok(motion_sensors[0].drv->set_data_rate(&motion_sensors[0], 0, + zassert_ok(motion_sensors[0].drv->set_data_rate(&motion_sensors[0], 0, false), NULL); zassert_ok(host_cmd_motion_sense_odr(/*sensor_num=*/0, @@ -774,7 +774,7 @@ ZTEST(host_cmd_motion_sense, test_int_enable) host_cmd_motion_sense_int_enable(2, &response), NULL); /* Make sure we start off disabled */ - zassume_ok(host_cmd_motion_sense_int_enable(0, &response)); + zassert_ok(host_cmd_motion_sense_int_enable(0, &response)); /* Test enable */ zassert_ok(host_cmd_motion_sense_int_enable(1, &response)); diff --git a/zephyr/test/drivers/host_cmd/src/pd_chip_info.c b/zephyr/test/drivers/host_cmd/src/pd_chip_info.c index 81c2485388..54c8786548 100644 --- a/zephyr/test/drivers/host_cmd/src/pd_chip_info.c +++ b/zephyr/test/drivers/host_cmd/src/pd_chip_info.c @@ -41,7 +41,7 @@ ZTEST_USER(host_cmd_pd_chip_info, test_bad_index) { struct ec_response_pd_chip_info_v1 response; - zassume_true(board_get_usb_pd_port_count() < BAD_PORT, + zassert_true(board_get_usb_pd_port_count() < BAD_PORT, "Intended bad port exists"); zassert_equal(run_pd_chip_info(BAD_PORT, &response), EC_RES_INVALID_PARAM, @@ -53,7 +53,7 @@ static void host_cmd_pd_chip_info_begin(void *data) ARG_UNUSED(data); /* Assume we have at least one USB-C port */ - zassume_true(board_get_usb_pd_port_count() > 0, + zassert_true(board_get_usb_pd_port_count() > 0, "Insufficient TCPCs found"); /* Set the system into S0, since the AP would drive these commands */ diff --git a/zephyr/test/drivers/host_cmd/src/pd_control.c b/zephyr/test/drivers/host_cmd/src/pd_control.c index e8de27f6ce..5fdd424db9 100644 --- a/zephyr/test/drivers/host_cmd/src/pd_control.c +++ b/zephyr/test/drivers/host_cmd/src/pd_control.c @@ -23,7 +23,7 @@ ZTEST_USER(host_cmd_pd_control, test_bad_index) struct host_cmd_handler_args args = BUILD_HOST_COMMAND_PARAMS(EC_CMD_PD_CONTROL, 0, params); - zassume_true(board_get_usb_pd_port_count() < BAD_PORT, + zassert_true(board_get_usb_pd_port_count() < BAD_PORT, "Intended bad port exists"); zassert_equal(host_command_process(&args), EC_RES_INVALID_PARAM, "Failed to fail pd_control for port %d", params.chip); @@ -47,7 +47,7 @@ ZTEST_USER(host_cmd_pd_control, test_pd_reset_resume) * the only HC return which would cover this is a state string, which * could be brittle. */ - zassume_true(pd_is_port_enabled(TEST_PORT), "Port not up at beginning"); + zassert_true(pd_is_port_enabled(TEST_PORT), "Port not up at beginning"); host_cmd_pd_control(TEST_PORT, PD_RESET); @@ -76,7 +76,7 @@ ZTEST_USER(host_cmd_pd_control, test_suspend_resume) * the only HC return which would cover this is a state string, which * could be brittle. */ - zassume_true(pd_is_port_enabled(TEST_PORT), "Port not up at beginning"); + zassert_true(pd_is_port_enabled(TEST_PORT), "Port not up at beginning"); host_cmd_pd_control(TEST_PORT, PD_SUSPEND); @@ -117,7 +117,7 @@ static void host_cmd_pd_control_begin(void *data) ARG_UNUSED(data); /* Assume we have at least one USB-C port */ - zassume_true(board_get_usb_pd_port_count() > 0, + zassert_true(board_get_usb_pd_port_count() > 0, "Insufficient TCPCs found"); /* Set the system into S0, since the AP would drive these commands */ diff --git a/zephyr/test/drivers/host_cmd/src/usb_pd_control.c b/zephyr/test/drivers/host_cmd/src/usb_pd_control.c index c439141da9..8947fdca8c 100644 --- a/zephyr/test/drivers/host_cmd/src/usb_pd_control.c +++ b/zephyr/test/drivers/host_cmd/src/usb_pd_control.c @@ -99,7 +99,7 @@ ZTEST_USER(host_cmd_usb_pd_control, test_bad_index) { struct ec_response_usb_pd_control_v2 response; - zassume_true(board_get_usb_pd_port_count() < BAD_PORT, + zassert_true(board_get_usb_pd_port_count() < BAD_PORT, "Intended bad port exists"); zassert_equal(run_usb_pd_control(BAD_PORT, &response), EC_RES_INVALID_PARAM, @@ -130,7 +130,7 @@ static void host_cmd_usb_pd_control_before(void *data) ARG_UNUSED(data); /* Assume we have at least one USB-C port */ - zassume_true(board_get_usb_pd_port_count() > 0, + zassert_true(board_get_usb_pd_port_count() > 0, "Insufficient TCPCs found"); /* Set the system into S0, since the AP would drive these commands */ -- cgit v1.2.1