summaryrefslogtreecommitdiff
path: root/test/usb_pd_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/usb_pd_console.c')
-rw-r--r--test/usb_pd_console.c59
1 files changed, 29 insertions, 30 deletions
diff --git a/test/usb_pd_console.c b/test/usb_pd_console.c
index 8587edfe94..80b9978ea3 100644
--- a/test/usb_pd_console.c
+++ b/test/usb_pd_console.c
@@ -17,8 +17,7 @@
#include "test_util.h"
/* Defined in implementation */
-int command_pd(int argc, char **argv);
-int remote_flashing(int argc, char **argv);
+int command_pd(int argc, const char **argv);
static enum debug_level prl_debug_level;
static enum debug_level pe_debug_level;
@@ -249,7 +248,7 @@ enum pd_cc_states pd_get_task_cc_state(int port)
static int test_command_pd_dump(void)
{
int argc = 3;
- char *argv[] = { "pd", "dump", "", 0, 0, 0 };
+ const char *argv[] = { "pd", "dump", "", 0, 0, 0 };
char test[2];
sprintf(test, "e");
@@ -277,7 +276,7 @@ static int test_command_pd_dump(void)
static int test_command_pd_try_src(void)
{
int argc = 3;
- char *argv[] = { "pd", "trysrc", "2", 0, 0 };
+ const char *argv[] = { "pd", "trysrc", "2", 0, 0 };
try_src_override = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -297,7 +296,7 @@ static int test_command_pd_try_src(void)
static int test_command_pd_version(void)
{
int argc = 2;
- char *argv[] = { "pd", "version", 0, 0, 0 };
+ const char *argv[] = { "pd", "version", 0, 0, 0 };
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -307,7 +306,7 @@ static int test_command_pd_version(void)
static int test_command_pd_arg_count(void)
{
int argc;
- char *argv[] = { "pd", "", 0, 0, 0 };
+ const char *argv[] = { "pd", "", 0, 0, 0 };
for (argc = 0; argc < 3; argc++)
TEST_ASSERT(command_pd(argc, argv) == EC_ERROR_PARAM_COUNT);
@@ -318,7 +317,7 @@ static int test_command_pd_arg_count(void)
static int test_command_pd_port_num(void)
{
int argc = 3;
- char *argv[10] = { "pd", "0", 0, 0, 0 };
+ const char *argv[10] = { "pd", "0", 0, 0, 0 };
char test[2];
sprintf(test, "%d", CONFIG_USB_PD_PORT_MAX_COUNT);
@@ -331,7 +330,7 @@ static int test_command_pd_port_num(void)
static int test_command_pd_tx(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "tx", 0, 0 };
+ const char *argv[] = { "pd", "0", "tx", 0, 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -344,7 +343,7 @@ static int test_command_pd_tx(void)
static int test_command_pd_charger(void)
{
int argc = 3;
- char *argv[] = { "pd", "1", "charger", 0, 0 };
+ const char *argv[] = { "pd", "1", "charger", 0, 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -357,7 +356,7 @@ static int test_command_pd_charger(void)
static int test_command_pd_dev1(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "dev", "20", 0 };
+ const char *argv[] = { "pd", "0", "dev", "20", 0 };
request = 0;
max_volt = 0;
@@ -372,7 +371,7 @@ static int test_command_pd_dev1(void)
static int test_command_pd_dev2(void)
{
int argc = 3;
- char *argv[] = { "pd", "1", "dev", 0, 0 };
+ const char *argv[] = { "pd", "1", "dev", 0, 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -386,7 +385,7 @@ static int test_command_pd_dev2(void)
static int test_command_pd_disable(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "disable", 0, 0 };
+ const char *argv[] = { "pd", "0", "disable", 0, 0 };
comm_enable = 1;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -399,7 +398,7 @@ static int test_command_pd_disable(void)
static int test_command_pd_enable(void)
{
int argc = 3;
- char *argv[] = { "pd", "1", "enable", 0, 0 };
+ const char *argv[] = { "pd", "1", "enable", 0, 0 };
comm_enable = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -412,7 +411,7 @@ static int test_command_pd_enable(void)
static int test_command_pd_hard(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "hard", 0, 0 };
+ const char *argv[] = { "pd", "0", "hard", 0, 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -425,7 +424,7 @@ static int test_command_pd_hard(void)
static int test_command_pd_soft(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "soft", 0, 0 };
+ const char *argv[] = { "pd", "0", "soft", 0, 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -438,7 +437,7 @@ static int test_command_pd_soft(void)
static int test_command_pd_swap1(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "swap", 0, 0 };
+ const char *argv[] = { "pd", "0", "swap", 0, 0 };
TEST_ASSERT(command_pd(argc, argv) == EC_ERROR_PARAM_COUNT);
@@ -448,7 +447,7 @@ static int test_command_pd_swap1(void)
static int test_command_pd_swap2(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "swap", "power", 0 };
+ const char *argv[] = { "pd", "0", "swap", "power", 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -461,7 +460,7 @@ static int test_command_pd_swap2(void)
static int test_command_pd_swap3(void)
{
int argc = 4;
- char *argv[] = { "pd", "1", "swap", "data", 0 };
+ const char *argv[] = { "pd", "1", "swap", "data", 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -474,7 +473,7 @@ static int test_command_pd_swap3(void)
static int test_command_pd_swap4(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "swap", "vconn", 0 };
+ const char *argv[] = { "pd", "0", "swap", "vconn", 0 };
request = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -487,7 +486,7 @@ static int test_command_pd_swap4(void)
static int test_command_pd_swap5(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "swap", "xyz", 0 };
+ const char *argv[] = { "pd", "0", "swap", "xyz", 0 };
TEST_ASSERT(command_pd(argc, argv) == EC_ERROR_PARAM3);
@@ -497,7 +496,7 @@ static int test_command_pd_swap5(void)
static int test_command_pd_dualrole0(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "dualrole", 0, 0 };
+ const char *argv[] = { "pd", "0", "dualrole", 0, 0 };
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -507,7 +506,7 @@ static int test_command_pd_dualrole0(void)
static int test_command_pd_dualrole1(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "dualrole", "on", 0 };
+ const char *argv[] = { "pd", "0", "dualrole", "on", 0 };
dr_state = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -520,7 +519,7 @@ static int test_command_pd_dualrole1(void)
static int test_command_pd_dualrole2(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "dualrole", "off", 0 };
+ const char *argv[] = { "pd", "0", "dualrole", "off", 0 };
dr_state = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -533,7 +532,7 @@ static int test_command_pd_dualrole2(void)
static int test_command_pd_dualrole3(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "dualrole", "freeze", 0 };
+ const char *argv[] = { "pd", "0", "dualrole", "freeze", 0 };
dr_state = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -546,7 +545,7 @@ static int test_command_pd_dualrole3(void)
static int test_command_pd_dualrole4(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "dualrole", "sink", 0 };
+ const char *argv[] = { "pd", "0", "dualrole", "sink", 0 };
dr_state = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -559,7 +558,7 @@ static int test_command_pd_dualrole4(void)
static int test_command_pd_dualrole5(void)
{
int argc = 4;
- char *argv[] = { "pd", "0", "dualrole", "source", 0 };
+ const char *argv[] = { "pd", "0", "dualrole", "source", 0 };
dr_state = 0;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -572,7 +571,7 @@ static int test_command_pd_dualrole5(void)
static int test_command_pd_state(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "state", 0, 0 };
+ const char *argv[] = { "pd", "0", "state", 0, 0 };
pd_get_polarity_called = false;
pd_comm_is_enabled_called = false;
@@ -601,7 +600,7 @@ static int test_command_pd_state(void)
static int test_command_pd_srccaps(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "srccaps", 0, 0 };
+ const char *argv[] = { "pd", "0", "srccaps", 0, 0 };
pd_srccaps_dump_called = false;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -613,7 +612,7 @@ static int test_command_pd_srccaps(void)
static int test_command_pd_timer(void)
{
int argc = 3;
- char *argv[] = { "pd", "0", "timer", 0, 0 };
+ const char *argv[] = { "pd", "0", "timer", 0, 0 };
pd_timer_dump_called = false;
TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
@@ -622,7 +621,7 @@ static int test_command_pd_timer(void)
return EC_SUCCESS;
}
-void run_test(int argc, char **argv)
+void run_test(int argc, const char **argv)
{
test_reset();