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.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/usb_pd_console.c b/test/usb_pd_console.c
index 711664aeb0..cb2539fea4 100644
--- a/test/usb_pd_console.c
+++ b/test/usb_pd_console.c
@@ -43,6 +43,7 @@ static enum pd_dpm_request request;
static int max_volt;
static int comm_enable;
static int pd_suspended;
+static int pd_bistsharemode;
static int dev_info;
static int vdm_cmd;
static int vdm_count;
@@ -186,6 +187,12 @@ void pd_set_suspend(int port, int enable)
pd_suspended = enable;
}
+enum ec_status pd_set_bist_share_mode(uint8_t enable)
+{
+ pd_bistsharemode = enable;
+ return EC_RES_SUCCESS;
+}
+
void tc_print_dev_info(int port)
{
test_port = port;
@@ -310,6 +317,30 @@ static int test_command_pd_version(void)
return EC_SUCCESS;
}
+static int test_command_pd_bistsharemode_enable(void)
+{
+ int argc = 3;
+ static const char *argv[10] = { "pd", "bistsharemode", "enable" };
+
+ pd_bistsharemode = -1;
+ TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
+ TEST_ASSERT(pd_bistsharemode == 1);
+
+ return EC_SUCCESS;
+}
+
+static int test_command_pd_bistsharemode_disable(void)
+{
+ int argc = 3;
+ static const char *argv[10] = { "pd", "bistsharemode", "disable" };
+
+ pd_bistsharemode = -1;
+ TEST_ASSERT(command_pd(argc, argv) == EC_SUCCESS);
+ TEST_ASSERT(pd_bistsharemode == 0);
+
+ return EC_SUCCESS;
+}
+
static int test_command_pd_arg_count(void)
{
int argc;
@@ -679,6 +710,8 @@ void run_test(int argc, const char **argv)
RUN_TEST(test_command_pd_soft);
RUN_TEST(test_command_pd_suspend);
RUN_TEST(test_command_pd_resume);
+ RUN_TEST(test_command_pd_bistsharemode_enable);
+ RUN_TEST(test_command_pd_bistsharemode_disable);
RUN_TEST(test_command_pd_swap1);
RUN_TEST(test_command_pd_swap2);
RUN_TEST(test_command_pd_swap3);