diff options
Diffstat (limited to 'zephyr/test/drivers/default/src/console_cmd')
41 files changed, 168 insertions, 292 deletions
diff --git a/zephyr/test/drivers/default/src/console_cmd/accelinfo.c b/zephyr/test/drivers/default/src/console_cmd/accelinfo.c index aac63c01b7..39556fab43 100644 --- a/zephyr/test/drivers/default/src/console_cmd/accelinfo.c +++ b/zephyr/test/drivers/default/src/console_cmd/accelinfo.c @@ -3,15 +3,15 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "config.h" #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "timer.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - static void console_cmd_accelinfo_after(void *fixture) { ARG_UNUSED(fixture); diff --git a/zephyr/test/drivers/default/src/console_cmd/accelinit.c b/zephyr/test/drivers/default/src/console_cmd/accelinit.c index 2633c05f58..e722409298 100644 --- a/zephyr/test/drivers/default/src/console_cmd/accelinit.c +++ b/zephyr/test/drivers/default/src/console_cmd/accelinit.c @@ -3,16 +3,16 @@ * found in the LICENSE file. */ +#include <zephyr/fff.h> +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "accelgyro.h" #include "console.h" #include "motion_sense.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/fff.h> -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - FAKE_VALUE_FUNC(int, mock_init, struct motion_sensor_t *); struct console_cmd_accelinit_fixture { diff --git a/zephyr/test/drivers/default/src/console_cmd/accelrange.c b/zephyr/test/drivers/default/src/console_cmd/accelrange.c index 04ec7e6004..57e81eada4 100644 --- a/zephyr/test/drivers/default/src/console_cmd/accelrange.c +++ b/zephyr/test/drivers/default/src/console_cmd/accelrange.c @@ -3,6 +3,10 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/devicetree.h> +#include <zephyr/ztest.h> + #include "console.h" #include "driver/accel_bma2x2.h" #include "ec_commands.h" @@ -12,10 +16,6 @@ #include "motion_sense.h" #include "test/drivers/test_state.h" -#include <zephyr/devicetree.h> -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - #define EMUL_NODE DT_NODELABEL(bma_emul) #define BMA_ORD DT_DEP_ORD(EMUL_LABEL) diff --git a/zephyr/test/drivers/default/src/console_cmd/accelrate.c b/zephyr/test/drivers/default/src/console_cmd/accelrate.c index 3a5b2cd9bf..ca5bcf338a 100644 --- a/zephyr/test/drivers/default/src/console_cmd/accelrate.c +++ b/zephyr/test/drivers/default/src/console_cmd/accelrate.c @@ -3,15 +3,15 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "motion_sense.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - static int original_sensor_0_s0_config_odr; static void *console_cmd_accelrate_setup(void) diff --git a/zephyr/test/drivers/default/src/console_cmd/accelread.c b/zephyr/test/drivers/default/src/console_cmd/accelread.c index e622faf58f..4a129badc1 100644 --- a/zephyr/test/drivers/default/src/console_cmd/accelread.c +++ b/zephyr/test/drivers/default/src/console_cmd/accelread.c @@ -3,6 +3,10 @@ * found in the LICENSE file. */ +#include <zephyr/fff.h> +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "accelgyro.h" #include "console.h" #include "ec_commands.h" @@ -10,10 +14,6 @@ #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/fff.h> -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - FAKE_VALUE_FUNC(int, mock_read, const struct motion_sensor_t *, int *); FAKE_VALUE_FUNC(int, mock_set_data_rate, const struct motion_sensor_t *, int, int); diff --git a/zephyr/test/drivers/default/src/console_cmd/accelres.c b/zephyr/test/drivers/default/src/console_cmd/accelres.c index 21c0075b0f..38bd4ed697 100644 --- a/zephyr/test/drivers/default/src/console_cmd/accelres.c +++ b/zephyr/test/drivers/default/src/console_cmd/accelres.c @@ -3,6 +3,10 @@ * found in the LICENSE file. */ +#include <zephyr/fff.h> +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "accelgyro.h" #include "console.h" #include "driver/accel_bma2x2.h" @@ -10,10 +14,6 @@ #include "motion_sense.h" #include "test/drivers/test_state.h" -#include <zephyr/fff.h> -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - FAKE_VALUE_FUNC(int, set_resolution, const struct motion_sensor_t *, int, int); struct console_cmd_accelres_fixture { diff --git a/zephyr/test/drivers/default/src/console_cmd/accelspoof.c b/zephyr/test/drivers/default/src/console_cmd/accelspoof.c index fe11525531..50f8c1e650 100644 --- a/zephyr/test/drivers/default/src/console_cmd/accelspoof.c +++ b/zephyr/test/drivers/default/src/console_cmd/accelspoof.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "motion_sense.h" #include "test/drivers/test_state.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - static void console_cmd_accelspoof_after(void *fixture) { ARG_UNUSED(fixture); diff --git a/zephyr/test/drivers/default/src/console_cmd/adc.c b/zephyr/test/drivers/default/src/console_cmd/adc.c index b366db36f6..85dfda939a 100644 --- a/zephyr/test/drivers/default/src/console_cmd/adc.c +++ b/zephyr/test/drivers/default/src/console_cmd/adc.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - /* Default adc command, lists out channels */ ZTEST_USER(console_cmd_adc, test_adc_noname) { diff --git a/zephyr/test/drivers/default/src/console_cmd/battery.c b/zephyr/test/drivers/default/src/console_cmd/battery.c index f5fa78d684..9c3e21fcf1 100644 --- a/zephyr/test/drivers/default/src/console_cmd/battery.c +++ b/zephyr/test/drivers/default/src/console_cmd/battery.c @@ -3,6 +3,10 @@ * found in the LICENSE file. */ +#include <zephyr/drivers/emul.h> +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "battery_smart.h" #include "console.h" #include "ec_commands.h" @@ -11,10 +15,6 @@ #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/drivers/emul.h> -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - struct console_cmd_battery_fixture { const struct emul *emul; struct i2c_common_emul_data *i2c_emul; diff --git a/zephyr/test/drivers/default/src/console_cmd/button.c b/zephyr/test/drivers/default/src/console_cmd/button.c index 0df137e90b..9272b2ce2d 100644 --- a/zephyr/test/drivers/default/src/console_cmd/button.c +++ b/zephyr/test/drivers/default/src/console_cmd/button.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_USER(console_cmd_button, test_button_no_arg) { int rv; diff --git a/zephyr/test/drivers/default/src/console_cmd/cbi.c b/zephyr/test/drivers/default/src/console_cmd/cbi.c index 297431657e..495ffd7e4c 100644 --- a/zephyr/test/drivers/default/src/console_cmd/cbi.c +++ b/zephyr/test/drivers/default/src/console_cmd/cbi.c @@ -3,12 +3,12 @@ * found in the LICENSE file. */ -#include "console.h" -#include "test/drivers/test_state.h" - #include <zephyr/shell/shell.h> #include <zephyr/ztest.h> +#include "console.h" +#include "test/drivers/test_state.h" + static void set_wp(bool value) { const struct gpio_dt_spec *wp = GPIO_DT_FROM_NODELABEL(gpio_wp_l); diff --git a/zephyr/test/drivers/default/src/console_cmd/charge_manager.c b/zephyr/test/drivers/default/src/console_cmd/charge_manager.c index 698db8b316..a4679ddd25 100644 --- a/zephyr/test/drivers/default/src/console_cmd/charge_manager.c +++ b/zephyr/test/drivers/default/src/console_cmd/charge_manager.c @@ -3,6 +3,9 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "charge_manager.h" #include "console.h" #include "emul/emul_isl923x.h" @@ -12,9 +15,6 @@ #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - struct console_cmd_charge_manager_fixture { struct tcpci_partner_data sink_5v_3a; struct tcpci_snk_emul_data sink_ext; @@ -111,7 +111,7 @@ ZTEST_USER(console_cmd_charge_manager, test_chgoverride_invalid_port) { char cmd[256]; - zassert_true(sprintf(cmd, "chgoverride %d", CHARGE_PORT_COUNT) > 0, + zassume_true(sprintf(cmd, "chgoverride %d", CHARGE_PORT_COUNT) > 0, NULL); zassert_equal(shell_execute_cmd(get_ec_shell(), cmd), EC_ERROR_PARAM1, NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/charge_state.c b/zephyr/test/drivers/default/src/console_cmd/charge_state.c index 8cfd11324f..7ee91049ae 100644 --- a/zephyr/test/drivers/default/src/console_cmd/charge_state.c +++ b/zephyr/test/drivers/default/src/console_cmd/charge_state.c @@ -3,6 +3,9 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "charge_state.h" #include "charge_state_v2.h" #include "console.h" @@ -10,9 +13,6 @@ #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_USER(console_cmd_charge_state, test_idle_too_few_args) { int rv; @@ -116,7 +116,7 @@ ZTEST_USER(console_cmd_charge_state, test_debug_on_show_charging_progress) charging_progress_displayed(); /* Enable debug printing */ - zassert_ok(shell_execute_cmd(get_ec_shell(), "chgstate debug on"), + zassume_ok(shell_execute_cmd(get_ec_shell(), "chgstate debug on"), NULL); /* Sleep at least 1 full iteration of the charge state loop */ @@ -159,16 +159,6 @@ ZTEST_USER(console_cmd_charge_state, test_sustain_invalid_params) zassert_equal(shell_execute_cmd(get_ec_shell(), "chgstate sustain 50 101"), EC_ERROR_INVAL, NULL); - - /* Verify invalid lower bound (not a number) */ - zassert_equal(shell_execute_cmd(get_ec_shell(), - "chgstate sustain a 50"), - EC_ERROR_PARAM2); - - /* Verify invalid uppoer bound (not a number) */ - zassert_equal(shell_execute_cmd(get_ec_shell(), - "chgstate sustain 30 a"), - EC_ERROR_PARAM3); } struct console_cmd_charge_state_fixture { @@ -216,7 +206,7 @@ ZTEST_USER_F(console_cmd_charge_state, test_idle_on_from_normal) fixture->tcpci_emul, fixture->charger_emul); /* Verify that we're in "normal" mode */ - zassert_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); + zassume_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); /* Move to idle */ zassert_ok(shell_execute_cmd(get_ec_shell(), "chgstate idle on")); @@ -230,11 +220,11 @@ ZTEST_USER_F(console_cmd_charge_state, test_normal_from_idle) fixture->tcpci_emul, fixture->charger_emul); /* Verify that we're in "normal" mode */ - zassert_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); + zassume_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); /* Move to idle */ - zassert_ok(shell_execute_cmd(get_ec_shell(), "chgstate idle on")); - zassert_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_IDLE); + zassume_ok(shell_execute_cmd(get_ec_shell(), "chgstate idle on")); + zassume_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_IDLE); /* Move back to normal */ zassert_ok(shell_execute_cmd(get_ec_shell(), "chgstate idle off"), @@ -249,7 +239,7 @@ ZTEST_USER_F(console_cmd_charge_state, test_discharge_on) fixture->tcpci_emul, fixture->charger_emul); /* Verify that we're in "normal" mode */ - zassert_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); + zassume_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); /* Enable discharge */ zassert_ok(shell_execute_cmd(get_ec_shell(), "chgstate discharge on"), @@ -264,12 +254,12 @@ ZTEST_USER_F(console_cmd_charge_state, test_discharge_off) fixture->tcpci_emul, fixture->charger_emul); /* Verify that we're in "normal" mode */ - zassert_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); + zassume_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_NORMAL); /* Enable discharge */ - zassert_ok(shell_execute_cmd(get_ec_shell(), "chgstate discharge on"), + zassume_ok(shell_execute_cmd(get_ec_shell(), "chgstate discharge on"), NULL); - zassert_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_DISCHARGE); + zassume_equal(get_chg_ctrl_mode(), CHARGE_CONTROL_DISCHARGE); /* Disable discharge */ zassert_ok(shell_execute_cmd(get_ec_shell(), "chgstate discharge off"), diff --git a/zephyr/test/drivers/default/src/console_cmd/chargen.c b/zephyr/test/drivers/default/src/console_cmd/chargen.c index 473ad78abb..649a1b0b1f 100644 --- a/zephyr/test/drivers/default/src/console_cmd/chargen.c +++ b/zephyr/test/drivers/default/src/console_cmd/chargen.c @@ -3,18 +3,17 @@ * found in the LICENSE file. */ -#include "console.h" -#include "system.h" -#include "test/drivers/test_state.h" -#include "test/drivers/utils.h" -#include "uart.h" - -#include <stdio.h> - #include <zephyr/drivers/emul.h> -#include <zephyr/drivers/uart/serial_test.h> #include <zephyr/shell/shell_dummy.h> #include <zephyr/ztest.h> +#include <stdio.h> +#include <zephyr/drivers/uart/serial_test.h> + +#include "console.h" +#include "uart.h" +#include "test/drivers/test_state.h" +#include "test/drivers/utils.h" +#include "system.h" const char expected_output[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" diff --git a/zephyr/test/drivers/default/src/console_cmd/charger.c b/zephyr/test/drivers/default/src/console_cmd/charger.c index 420ef67fe4..9adda29a8d 100644 --- a/zephyr/test/drivers/default/src/console_cmd/charger.c +++ b/zephyr/test/drivers/default/src/console_cmd/charger.c @@ -3,15 +3,15 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "dptf.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - /* Tests which need no fixture */ ZTEST_USER(console_cmd_charger, test_default_dump) { @@ -81,7 +81,7 @@ ZTEST_USER(console_cmd_charger, test_good_input_current) zassert_ok(shell_execute_cmd(get_ec_shell(), "charger input 1000"), "Failed to set input current"); - zassert_ok(charger_get_input_current_limit(0, &input_current), + zassume_ok(charger_get_input_current_limit(0, &input_current), "Failed to get input current"); zassert_equal(input_current, 1000, "Input current not set in charger: %d", input_current); @@ -117,7 +117,7 @@ static void *console_cmd_charger_setup(void) static struct console_cmd_charger_fixture fixture; /* Assume we have one charger at index 0 */ - zassert_true(board_get_charger_chip_count() > 0, + zassume_true(board_get_charger_chip_count() > 0, "Insufficient chargers found"); /* Get references for the emulators */ @@ -158,7 +158,7 @@ ZTEST_USER_F(console_cmd_charger, test_good_current) /* Give the charger task time to pick up the manual current */ k_sleep(K_SECONDS(1)); - zassert_ok(charger_get_current(0, ¤t), "Failed to get current"); + zassume_ok(charger_get_current(0, ¤t), "Failed to get current"); zassert_equal(current, 1000, "Current not set in charger: %d", current); } @@ -176,7 +176,7 @@ ZTEST_USER_F(console_cmd_charger, test_good_voltage) /* Give the charger task time to pick up the manual voltage */ k_sleep(K_SECONDS(1)); - zassert_ok(charger_get_voltage(0, &voltage), "Failed to get voltage"); + zassume_ok(charger_get_voltage(0, &voltage), "Failed to get voltage"); zassert_equal(voltage, 3000, "Voltage not set in charger: %d", voltage); } diff --git a/zephyr/test/drivers/default/src/console_cmd/crash.c b/zephyr/test/drivers/default/src/console_cmd/crash.c index 4218aa74d6..bc0b5d0254 100644 --- a/zephyr/test/drivers/default/src/console_cmd/crash.c +++ b/zephyr/test/drivers/default/src/console_cmd/crash.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #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); diff --git a/zephyr/test/drivers/default/src/console_cmd/cutoff.c b/zephyr/test/drivers/default/src/console_cmd/cutoff.c index 2b5a9c67d2..00ce40660f 100644 --- a/zephyr/test/drivers/default/src/console_cmd/cutoff.c +++ b/zephyr/test/drivers/default/src/console_cmd/cutoff.c @@ -3,6 +3,9 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "battery.h" #include "console.h" #include "ec_commands.h" @@ -10,9 +13,6 @@ #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - static void console_cmd_cutoff_after(void *unused) { ARG_UNUSED(unused); @@ -58,7 +58,7 @@ ZTEST_USER(console_cmd_cutoff, test_clear_pending_shutdown) { int rv = shell_execute_cmd(get_ec_shell(), "cutoff at-shutdown"); - zassert_true(extpower_is_present(), NULL); + zassume_true(extpower_is_present(), NULL); zassert_equal(EC_RES_SUCCESS, rv, "Expected %d, but got %d", EC_RES_SUCCESS, rv); diff --git a/zephyr/test/drivers/default/src/console_cmd/ec_features.c b/zephyr/test/drivers/default/src/console_cmd/ec_features.c index 48e6eec819..b33ca565bc 100644 --- a/zephyr/test/drivers/default/src/console_cmd/ec_features.c +++ b/zephyr/test/drivers/default/src/console_cmd/ec_features.c @@ -3,27 +3,23 @@ * found in the LICENSE file. */ -#include "builtin/stdio.h" +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "host_command.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_SUITE(console_cmd_ec_features, drivers_predicate_post_main, NULL, NULL, NULL, NULL); ZTEST_USER(console_cmd_ec_features, test_feat) { - char expected[50]; - int ret; + char expected[32]; - ret = snprintf(expected, sizeof(expected), - " 0-31: 0x%08x\r\n32-63: 0x%08x", get_feature_flags0(), - get_feature_flags1()); - zassert_true(ret >= 0 && ret < sizeof(expected)); + snprintf(expected, sizeof(expected), " 0-31: 0x%08x\r\n32-63: 0x%08x", + get_feature_flags0(), get_feature_flags1()); CHECK_CONSOLE_CMD("feat", expected, EC_SUCCESS); } diff --git a/zephyr/test/drivers/default/src/console_cmd/gpio.c b/zephyr/test/drivers/default/src/console_cmd/gpio.c index c4b83b8ab4..164f272e27 100644 --- a/zephyr/test/drivers/default/src/console_cmd/gpio.c +++ b/zephyr/test/drivers/default/src/console_cmd/gpio.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_USER(console_cmd_gpio, test_read_invoke_success) { zassert_ok(shell_execute_cmd(get_ec_shell(), "gpioget test"), NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/hcdebug.c b/zephyr/test/drivers/default/src/console_cmd/hcdebug.c index 68dc6c72be..71adb02690 100644 --- a/zephyr/test/drivers/default/src/console_cmd/hcdebug.c +++ b/zephyr/test/drivers/default/src/console_cmd/hcdebug.c @@ -3,13 +3,13 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - static void console_cmd_hcdebug_after(void *fixture) { ARG_UNUSED(fixture); diff --git a/zephyr/test/drivers/default/src/console_cmd/hibdelay.c b/zephyr/test/drivers/default/src/console_cmd/hibdelay.c index 8275ece94d..c72a2bf66a 100644 --- a/zephyr/test/drivers/default/src/console_cmd/hibdelay.c +++ b/zephyr/test/drivers/default/src/console_cmd/hibdelay.c @@ -3,13 +3,13 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_SUITE(console_cmd_hibdelay, drivers_predicate_post_main, NULL, NULL, NULL, NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/hostevent.c b/zephyr/test/drivers/default/src/console_cmd/hostevent.c index 85717e88d1..af9b37edd1 100644 --- a/zephyr/test/drivers/default/src/console_cmd/hostevent.c +++ b/zephyr/test/drivers/default/src/console_cmd/hostevent.c @@ -3,15 +3,15 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "include/lpc.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - #ifdef CONFIG_HOST_EVENT64 #define HOSTEVENT_PRINT_FORMAT "016" PRIx64 #else @@ -52,7 +52,7 @@ static int console_cmd_hostevent(const char *subcommand, host_event_t mask) "hostevent %s 0x%" HOSTEVENT_PRINT_FORMAT, subcommand, mask); - zassert_between_inclusive(rv, 0, CONFIG_SHELL_CMD_BUFF_SIZE, + zassume_between_inclusive(rv, 0, CONFIG_SHELL_CMD_BUFF_SIZE, "hostevent console command too long"); return shell_execute_cmd(get_ec_shell(), cmd_buf); diff --git a/zephyr/test/drivers/default/src/console_cmd/i2c_portmap.c b/zephyr/test/drivers/default/src/console_cmd/i2c_portmap.c index 7651127218..4b2ec548a2 100644 --- a/zephyr/test/drivers/default/src/console_cmd/i2c_portmap.c +++ b/zephyr/test/drivers/default/src/console_cmd/i2c_portmap.c @@ -3,13 +3,13 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_SUITE(console_cmd_i2c_portmap, drivers_predicate_post_main, NULL, NULL, NULL, NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/md.c b/zephyr/test/drivers/default/src/console_cmd/md.c index 0db049a635..c8c3e2c130 100644 --- a/zephyr/test/drivers/default/src/console_cmd/md.c +++ b/zephyr/test/drivers/default/src/console_cmd/md.c @@ -3,12 +3,12 @@ * found in the LICENSE file. */ -#include "console.h" -#include "test/drivers/test_state.h" - #include <zephyr/shell/shell.h> #include <zephyr/ztest.h> +#include "console.h" +#include "test/drivers/test_state.h" + ZTEST_SUITE(console_cmd_md, drivers_predicate_post_main, NULL, NULL, NULL, NULL); @@ -36,7 +36,7 @@ ZTEST_USER(console_cmd_md, test_default_count) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 }; char cmd[128] = { 0 }; - zassert_true(sprintf(cmd, "md %" PRIuPTR, (uintptr_t)memory) != 0, + zassume_true(sprintf(cmd, "md %" PRIuPTR, (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -46,7 +46,7 @@ ZTEST_USER(console_cmd_md, test_count_arg) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; char cmd[128] = { 0 }; - zassert_true(sprintf(cmd, "md %" PRIuPTR " 2", (uintptr_t)memory) != 0, + zassume_true(sprintf(cmd, "md %" PRIuPTR " 2", (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -56,7 +56,7 @@ ZTEST_USER(console_cmd_md, test_byte_format) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 }; char cmd[128] = { 0 }; - zassert_true(sprintf(cmd, "md .b %" PRIuPTR, (uintptr_t)memory) != 0, + zassume_true(sprintf(cmd, "md .b %" PRIuPTR, (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -66,7 +66,7 @@ ZTEST_USER(console_cmd_md, test_half_format) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 }; char cmd[128] = { 0 }; - zassert_true(sprintf(cmd, "md .h %" PRIuPTR, (uintptr_t)memory) != 0, + zassume_true(sprintf(cmd, "md .h %" PRIuPTR, (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -76,7 +76,7 @@ ZTEST_USER(console_cmd_md, test_string_format) char memory[] = "hello world"; char cmd[128] = { 0 }; - zassert_true(sprintf(cmd, "md .s %" PRIuPTR " 12", (uintptr_t)memory) != + zassume_true(sprintf(cmd, "md .s %" PRIuPTR " 12", (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/panic_output.c b/zephyr/test/drivers/default/src/console_cmd/panic_output.c index 0d98ec6d08..7cc809e835 100644 --- a/zephyr/test/drivers/default/src/console_cmd/panic_output.c +++ b/zephyr/test/drivers/default/src/console_cmd/panic_output.c @@ -3,15 +3,15 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "panic.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - /* Test panicinfo when a panic hasn't occurred */ ZTEST_USER(console_cmd_panic_output, test_panicinfo) { diff --git a/zephyr/test/drivers/default/src/console_cmd/port80.c b/zephyr/test/drivers/default/src/console_cmd/port80.c index 1d7eb2ad03..792895eb27 100644 --- a/zephyr/test/drivers/default/src/console_cmd/port80.c +++ b/zephyr/test/drivers/default/src/console_cmd/port80.c @@ -8,17 +8,18 @@ * @brief Unit Tests for ESPI port 80 console command */ +#include <zephyr/logging/log.h> +#include <zephyr/shell/shell.h> +#include <zephyr/kernel.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "port80.h" + #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/kernel.h> -#include <zephyr/logging/log.h> -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - /** * @brief TestPurpose: Verify port 80 console commands * diff --git a/zephyr/test/drivers/default/src/console_cmd/power_button.c b/zephyr/test/drivers/default/src/console_cmd/power_button.c index d9900e8667..92d0aeaf78 100644 --- a/zephyr/test/drivers/default/src/console_cmd/power_button.c +++ b/zephyr/test/drivers/default/src/console_cmd/power_button.c @@ -4,7 +4,6 @@ */ #include <zephyr/ztest.h> - #include <console.h> ZTEST_SUITE(console_cmd_power_button, NULL, NULL, NULL, NULL, NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/powerindebug.c b/zephyr/test/drivers/default/src/console_cmd/powerindebug.c index 946960ea86..9f52a9b569 100644 --- a/zephyr/test/drivers/default/src/console_cmd/powerindebug.c +++ b/zephyr/test/drivers/default/src/console_cmd/powerindebug.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_USER(console_cmd_powerindebug, test_no_params) { zassert_ok(shell_execute_cmd(get_ec_shell(), "powerindebug"), diff --git a/zephyr/test/drivers/default/src/console_cmd/pwr_avg.c b/zephyr/test/drivers/default/src/console_cmd/pwr_avg.c deleted file mode 100644 index b21755a465..0000000000 --- a/zephyr/test/drivers/default/src/console_cmd/pwr_avg.c +++ /dev/null @@ -1,47 +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 "battery.h" -#include "console.h" -#include "test/drivers/test_state.h" -#include "test/drivers/utils.h" - -#include <stdio.h> - -#include <zephyr/shell/shell.h> -#include <zephyr/shell/shell_dummy.h> -#include <zephyr/ztest.h> - -ZTEST_SUITE(console_cmd_pwr_avg, drivers_predicate_post_main, NULL, NULL, NULL, - NULL); - -ZTEST_USER(console_cmd_pwr_avg, test_too_many_args) -{ - zassert_equal(EC_ERROR_PARAM_COUNT, - shell_execute_cmd(get_ec_shell(), "pwr_avg 5")); -} - -ZTEST_USER(console_cmd_pwr_avg, test_printout) -{ - int mv = battery_get_avg_voltage(); - int ma = battery_get_avg_current(); - char expected_output[1024]; - const char *buffer; - size_t buffer_size; - - shell_backend_dummy_clear_output(get_ec_shell()); - zassert_ok(shell_execute_cmd(get_ec_shell(), "pwr_avg")); - - buffer = shell_backend_dummy_get_output(get_ec_shell(), &buffer_size); - - sprintf(expected_output, "mv = %d", mv); - zassert_true(strstr(buffer, expected_output)); - - sprintf(expected_output, "ma = %d", ma); - zassert_true(strstr(buffer, expected_output)); - - sprintf(expected_output, "mw = %d", mv * ma / 1000); - zassert_true(strstr(buffer, expected_output)); -} diff --git a/zephyr/test/drivers/default/src/console_cmd/rtc.c b/zephyr/test/drivers/default/src/console_cmd/rtc.c index 974d3709b7..80530129af 100644 --- a/zephyr/test/drivers/default/src/console_cmd/rtc.c +++ b/zephyr/test/drivers/default/src/console_cmd/rtc.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "system.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/ztest.h> - ZTEST_USER(console_cmd_rtc, test_rtc_no_arg) { char expected_buffer[32]; diff --git a/zephyr/test/drivers/default/src/console_cmd/rw.c b/zephyr/test/drivers/default/src/console_cmd/rw.c index 1560254f92..aac37680f5 100644 --- a/zephyr/test/drivers/default/src/console_cmd/rw.c +++ b/zephyr/test/drivers/default/src/console_cmd/rw.c @@ -3,12 +3,12 @@ * found in the LICENSE file. */ -#include "console.h" -#include "test/drivers/test_state.h" - #include <zephyr/shell/shell.h> #include <zephyr/ztest.h> +#include "console.h" +#include "test/drivers/test_state.h" + ZTEST_SUITE(console_cmd_rw, drivers_predicate_post_main, NULL, NULL, NULL, NULL); @@ -43,15 +43,15 @@ ZTEST_USER(console_cmd_rw, test_read) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 }; char cmd[128] = { 0 }; - zassert_true(sprintf(cmd, "rw .b %" PRIuPTR, (uintptr_t)memory) != 0, + zassume_true(sprintf(cmd, "rw .b %" PRIuPTR, (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); - zassert_true(sprintf(cmd, "rw .h %" PRIuPTR, (uintptr_t)memory) != 0, + zassume_true(sprintf(cmd, "rw .h %" PRIuPTR, (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); - zassert_true(sprintf(cmd, "rw %" PRIuPTR, (uintptr_t)memory) != 0, + zassume_true(sprintf(cmd, "rw %" PRIuPTR, (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -71,7 +71,7 @@ ZTEST_USER(console_cmd_rw, test_write) uint8_t memory[4] = { 0 }; char cmd[128] = { 0 }; - zassert_true(sprintf(cmd, "rw .b %" PRIuPTR " 1", (uintptr_t)memory) != + zassume_true(sprintf(cmd, "rw .b %" PRIuPTR " 1", (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); @@ -81,7 +81,7 @@ ZTEST_USER(console_cmd_rw, test_write) zassert_equal(0, memory[3], "memory[3] was %u", memory[3]); memset(memory, 0, 4); - zassert_true(sprintf(cmd, "rw .h %" PRIuPTR " 258", + zassume_true(sprintf(cmd, "rw .h %" PRIuPTR " 258", (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); @@ -91,7 +91,7 @@ ZTEST_USER(console_cmd_rw, test_write) zassert_equal(0, memory[3], "memory[3] was %u", memory[3]); memset(memory, 0, 4); - zassert_true(sprintf(cmd, "rw %" PRIuPTR " 16909060", + zassume_true(sprintf(cmd, "rw %" PRIuPTR " 16909060", (uintptr_t)memory) != 0, NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/shared_mem.c b/zephyr/test/drivers/default/src/console_cmd/shared_mem.c index ed796124e4..e7b9396509 100644 --- a/zephyr/test/drivers/default/src/console_cmd/shared_mem.c +++ b/zephyr/test/drivers/default/src/console_cmd/shared_mem.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "shared_mem.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_SUITE(console_cmd_shared_mem, drivers_predicate_post_main, NULL, NULL, NULL, NULL); diff --git a/zephyr/test/drivers/default/src/console_cmd/sleepmask.c b/zephyr/test/drivers/default/src/console_cmd/sleepmask.c index 40d174e6af..6ae017dc66 100644 --- a/zephyr/test/drivers/default/src/console_cmd/sleepmask.c +++ b/zephyr/test/drivers/default/src/console_cmd/sleepmask.c @@ -3,15 +3,15 @@ * found in the LICENSE file. */ -#include "console.h" -#include "system.h" -#include "test/drivers/test_state.h" -#include "test/drivers/utils.h" - #include <zephyr/drivers/emul.h> #include <zephyr/shell/shell_dummy.h> #include <zephyr/ztest.h> +#include "console.h" +#include "test/drivers/test_state.h" +#include "test/drivers/utils.h" +#include "system.h" + ZTEST_USER(console_cmd_sleepmask, test_no_args) { const struct shell *shell_zephyr = get_ec_shell(); diff --git a/zephyr/test/drivers/default/src/console_cmd/sleeptimeout.c b/zephyr/test/drivers/default/src/console_cmd/sleeptimeout.c index 3bd8a39f3f..d802eb5948 100644 --- a/zephyr/test/drivers/default/src/console_cmd/sleeptimeout.c +++ b/zephyr/test/drivers/default/src/console_cmd/sleeptimeout.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_USER(console_cmd_sleeptimeout, test_no_params) { zassert_ok(shell_execute_cmd(get_ec_shell(), "sleeptimeout"), diff --git a/zephyr/test/drivers/default/src/console_cmd/switch.c b/zephyr/test/drivers/default/src/console_cmd/switch.c deleted file mode 100644 index f533ebe7b9..0000000000 --- a/zephyr/test/drivers/default/src/console_cmd/switch.c +++ /dev/null @@ -1,31 +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 "console.h" -#include "test/drivers/test_state.h" -#include "test/drivers/utils.h" - -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - -ZTEST_SUITE(console_cmd_switch, drivers_predicate_post_main, NULL, NULL, NULL, - NULL); - -ZTEST_USER(console_cmd_switch, test_mmapinfo) -{ - uint8_t *memmap_switches = host_get_memmap(EC_MEMMAP_SWITCHES); - uint8_t before = *memmap_switches; - char expected[32]; - - *memmap_switches = 0x3; - snprintf(expected, sizeof(expected), "memmap switches = 0x%x", - *memmap_switches); - - CHECK_CONSOLE_CMD("mmapinfo", expected, EC_SUCCESS); - CHECK_CONSOLE_CMD("mmapinfo", "lid_open", EC_SUCCESS); - CHECK_CONSOLE_CMD("mmapinfo", "powerbtn", EC_SUCCESS); - - *memmap_switches = before; -} diff --git a/zephyr/test/drivers/default/src/console_cmd/sysinfo.c b/zephyr/test/drivers/default/src/console_cmd/sysinfo.c index ba14e9158f..3aeef6510c 100644 --- a/zephyr/test/drivers/default/src/console_cmd/sysinfo.c +++ b/zephyr/test/drivers/default/src/console_cmd/sysinfo.c @@ -3,17 +3,17 @@ * found in the LICENSE file. */ -#include "console.h" -#include "system.h" -#include "test/drivers/test_mocks.h" -#include "test/drivers/test_state.h" -#include "test/drivers/utils.h" - #include <zephyr/drivers/emul.h> #include <zephyr/fff.h> #include <zephyr/shell/shell_dummy.h> #include <zephyr/ztest.h> +#include "console.h" +#include "test/drivers/test_mocks.h" +#include "test/drivers/test_state.h" +#include "test/drivers/utils.h" +#include "system.h" + ZTEST_USER(console_cmd_sysinfo, test_no_args) { const struct shell *shell_zephyr = get_ec_shell(); diff --git a/zephyr/test/drivers/default/src/console_cmd/tcpci_dump.c b/zephyr/test/drivers/default/src/console_cmd/tcpci_dump.c index fc8533280b..9652519cab 100644 --- a/zephyr/test/drivers/default/src/console_cmd/tcpci_dump.c +++ b/zephyr/test/drivers/default/src/console_cmd/tcpci_dump.c @@ -3,14 +3,14 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - ZTEST_USER(console_cmd_tcpci_dump, test_no_params) { int rv = shell_execute_cmd(get_ec_shell(), "tcpci_dump"); @@ -38,7 +38,7 @@ static void console_cmd_tcpci_dump_begin(void *data) ARG_UNUSED(data); /* Assume we have at least one TCPC */ - zassert_true(board_get_charger_chip_count() > 0, + zassume_true(board_get_charger_chip_count() > 0, "Insufficient TCPCs found"); } diff --git a/zephyr/test/drivers/default/src/console_cmd/usb_pd_console.c b/zephyr/test/drivers/default/src/console_cmd/usb_pd_console.c index 859205f403..d521f7bb06 100644 --- a/zephyr/test/drivers/default/src/console_cmd/usb_pd_console.c +++ b/zephyr/test/drivers/default/src/console_cmd/usb_pd_console.c @@ -3,17 +3,17 @@ * found in the LICENSE file. */ +#include <zephyr/shell/shell.h> +#include <zephyr/ztest.h> + #include "console.h" #include "ec_commands.h" #include "test/drivers/test_state.h" #include "test/drivers/utils.h" #include "usb_pd.h" -#include "usb_pd_dpm_sm.h" +#include "usb_pd_dpm.h" #include "usb_prl_sm.h" -#include <zephyr/shell/shell.h> -#include <zephyr/ztest.h> - static void console_cmd_usb_pd_after(void *fixture) { ARG_UNUSED(fixture); @@ -188,10 +188,6 @@ ZTEST_USER(console_cmd_usb_pd, test_bistsharemode) rv = shell_execute_cmd(get_ec_shell(), "pd bistsharemode disable"); zassert_equal(rv, EC_SUCCESS, "Expected %d, but got %d", EC_SUCCESS, rv); - - rv = shell_execute_cmd(get_ec_shell(), "pd bistsharemode foo"); - zassert_equal(rv, EC_ERROR_PARAM2, "Expected %d, but got %d", - EC_ERROR_PARAM2, rv); } ZTEST_USER(console_cmd_usb_pd, test_hard) @@ -268,22 +264,6 @@ ZTEST_USER(console_cmd_usb_pd, test_dualrole) rv = shell_execute_cmd(get_ec_shell(), "pd 0 dualrole x"); zassert_equal(rv, EC_ERROR_PARAM4, "Expected %d, but got %d", EC_ERROR_PARAM4, rv); - - pd_set_dual_role(0, PD_DRP_TOGGLE_OFF); - CHECK_CONSOLE_CMD("pd 0 dualrole", "dual-role toggling: off", - EC_SUCCESS); - - pd_set_dual_role(0, PD_DRP_FREEZE); - CHECK_CONSOLE_CMD("pd 0 dualrole", "dual-role toggling: freeze", - EC_SUCCESS); - - pd_set_dual_role(0, PD_DRP_FORCE_SINK); - CHECK_CONSOLE_CMD("pd 0 dualrole", "dual-role toggling: force sink", - EC_SUCCESS); - - pd_set_dual_role(0, PD_DRP_FORCE_SOURCE); - CHECK_CONSOLE_CMD("pd 0 dualrole", "dual-role toggling: force source", - EC_SUCCESS); } ZTEST_USER(console_cmd_usb_pd, test_state) @@ -313,15 +293,6 @@ ZTEST_USER(console_cmd_usb_pd, test_timer) rv); } -ZTEST_USER(console_cmd_usb_pd, test_cc) -{ - char expected_output[10]; - - snprintf(expected_output, sizeof(expected_output), "C0 CC%d", - pd_get_task_cc_state(0)); - CHECK_CONSOLE_CMD("pd 0 cc", expected_output, EC_SUCCESS); -} - static void set_device_vdo(int port, enum tcpci_msg_type type) { union tbt_mode_resp_device device_resp; diff --git a/zephyr/test/drivers/default/src/console_cmd/vboot_hash.c b/zephyr/test/drivers/default/src/console_cmd/vboot_hash.c index bdc9dddc66..b475f344c8 100644 --- a/zephyr/test/drivers/default/src/console_cmd/vboot_hash.c +++ b/zephyr/test/drivers/default/src/console_cmd/vboot_hash.c @@ -2,6 +2,12 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ +#include <string.h> +#include <zephyr/fff.h> +#include <zephyr/shell/shell_dummy.h> +#include <zephyr/sys/util.h> +#include <zephyr/ztest.h> + #include "console.h" #include "flash.h" #include "printf.h" @@ -10,13 +16,6 @@ #include "test/drivers/test_state.h" #include "vboot_hash.h" -#include <string.h> - -#include <zephyr/fff.h> -#include <zephyr/shell/shell_dummy.h> -#include <zephyr/sys/util.h> -#include <zephyr/ztest.h> - #define CUSTOM_HASH_LENGTH (32) struct console_cmd_hash_fixture { diff --git a/zephyr/test/drivers/default/src/console_cmd/version.c b/zephyr/test/drivers/default/src/console_cmd/version.c index e3606b5d0e..932cc51449 100644 --- a/zephyr/test/drivers/default/src/console_cmd/version.c +++ b/zephyr/test/drivers/default/src/console_cmd/version.c @@ -3,15 +3,15 @@ * found in the LICENSE file. */ -#include "console.h" -#include "system.h" -#include "test/drivers/test_state.h" -#include "test/drivers/utils.h" - #include <zephyr/drivers/emul.h> #include <zephyr/shell/shell_dummy.h> #include <zephyr/ztest.h> +#include "console.h" +#include "test/drivers/test_state.h" +#include "test/drivers/utils.h" +#include "system.h" + ZTEST_USER(console_cmd_version, test_no_args) { const struct shell *shell_zephyr = get_ec_shell(); diff --git a/zephyr/test/drivers/default/src/console_cmd/waitms.c b/zephyr/test/drivers/default/src/console_cmd/waitms.c index 703e233568..0d03ee7414 100644 --- a/zephyr/test/drivers/default/src/console_cmd/waitms.c +++ b/zephyr/test/drivers/default/src/console_cmd/waitms.c @@ -3,14 +3,13 @@ * found in the LICENSE file. */ -#include "console.h" -#include "timer.h" - #include <stdio.h> - #include <zephyr/shell/shell.h> #include <zephyr/ztest.h> +#include "console.h" +#include "timer.h" + static void test_int(int ms) { char cmd[32]; |