diff options
-rw-r--r-- | zephyr/test/drivers/default/src/console_cmd/md.c | 16 | ||||
-rw-r--r-- | zephyr/test/drivers/default/src/power_common.c | 8 |
2 files changed, 16 insertions, 8 deletions
diff --git a/zephyr/test/drivers/default/src/console_cmd/md.c b/zephyr/test/drivers/default/src/console_cmd/md.c index 8e3d00c255..c8cc3f847f 100644 --- a/zephyr/test/drivers/default/src/console_cmd/md.c +++ b/zephyr/test/drivers/default/src/console_cmd/md.c @@ -36,7 +36,8 @@ ZTEST_USER(console_cmd_md, test_default_count) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 }; char cmd[128] = { 0 }; - zassume_true(sprintf(cmd, "md %llu", memory) != 0, NULL); + zassume_true(sprintf(cmd, "md %" PRIuPTR, (uintptr_t)memory) != 0, + NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -45,7 +46,8 @@ ZTEST_USER(console_cmd_md, test_count_arg) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; char cmd[128] = { 0 }; - zassume_true(sprintf(cmd, "md %llu 2", memory) != 0, NULL); + zassume_true(sprintf(cmd, "md %" PRIuPTR " 2", (uintptr_t)memory) != 0, + NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -54,7 +56,8 @@ ZTEST_USER(console_cmd_md, test_byte_format) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 }; char cmd[128] = { 0 }; - zassume_true(sprintf(cmd, "md .b %llu", memory) != 0, NULL); + zassume_true(sprintf(cmd, "md .b %" PRIuPTR, (uintptr_t)memory) != 0, + NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -63,7 +66,8 @@ ZTEST_USER(console_cmd_md, test_half_format) uint8_t memory[] = { 0x01, 0x02, 0x03, 0x04 }; char cmd[128] = { 0 }; - zassume_true(sprintf(cmd, "md .h %llu", memory) != 0, NULL); + zassume_true(sprintf(cmd, "md .h %" PRIuPTR, (uintptr_t)memory) != 0, + NULL); zassert_ok(shell_execute_cmd(get_ec_shell(), cmd), NULL); } @@ -72,6 +76,8 @@ ZTEST_USER(console_cmd_md, test_string_format) char memory[] = "hello world"; char cmd[128] = { 0 }; - zassume_true(sprintf(cmd, "md .s %llu 12", memory) != 0, NULL); + 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/power_common.c b/zephyr/test/drivers/default/src/power_common.c index 537ad9b1d7..23931f322f 100644 --- a/zephyr/test/drivers/default/src/power_common.c +++ b/zephyr/test/drivers/default/src/power_common.c @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -#include <strings.h> +#include <string.h> #include <zephyr/ztest.h> #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/gpio/gpio_emul.h> @@ -464,7 +464,8 @@ ZTEST(power_common, power_console_cmd) zassert_equal(EC_SUCCESS, shell_execute_cmd(get_ec_shell(), "power"), NULL); buffer = shell_backend_dummy_get_output(get_ec_shell(), &buffer_size); - zassert_true(strcasecmp(buffer, "\r\noff\r\n") == 0, + zassert_true(strcmp(buffer, "\r\noff\r\n") == 0 || + strcmp(buffer, "\r\nOFF\r\n") == 0, "Invalid console output %s", buffer); test_set_chipset_to_s0(); @@ -472,7 +473,8 @@ ZTEST(power_common, power_console_cmd) zassert_equal(EC_SUCCESS, shell_execute_cmd(get_ec_shell(), "power"), NULL); buffer = shell_backend_dummy_get_output(get_ec_shell(), &buffer_size); - zassert_true(strcasecmp(buffer, "\r\non\r\n") == 0, + zassert_true(strcmp(buffer, "\r\non\r\n") == 0 || + strcmp(buffer, "\r\nON\r\n") == 0, "Invalid console output %s", buffer); zassert_equal(EC_ERROR_PARAM1, |