diff options
author | Tristan Honscheid <honscheid@google.com> | 2022-08-31 15:40:16 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-01 20:37:33 +0000 |
commit | d243e0376964036cda67a5f4f306d8bb615cf126 (patch) | |
tree | 0c32944b9419ffdbb7932386945ea0a01088b195 /common | |
parent | 7417a111b5fb4078ec17835960d4263813505bd5 (diff) | |
download | chrome-ec-d243e0376964036cda67a5f4f306d8bb615cf126.tar.gz |
zephyr: test: Test `dps` console command in `common/dps.c`
Test the `dps` console command
BRANCH=None
BUG=None
TEST=./twister
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Change-Id: I89cbbf8658a6fbb25782e37048a3fa75d77e4fee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3867045
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/dps.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/dps.c b/common/dps.c index ee2fd7e65d..e984c9e725 100644 --- a/common/dps.c +++ b/common/dps.c @@ -685,3 +685,22 @@ static enum ec_status hc_usb_pd_dps_control(struct host_cmd_handler_args *args) } DECLARE_HOST_COMMAND(EC_CMD_USB_PD_DPS_CONTROL, hc_usb_pd_dps_control, EC_VER_MASK(0)); + +#ifdef TEST_BUILD +__test_only bool dps_is_fake_enabled(void) +{ + return fake_enabled; +} +__test_only int dps_get_fake_mv(void) +{ + return fake_mv; +} +__test_only int dps_get_fake_ma(void) +{ + return fake_ma; +} +__test_only int *dps_get_debug_level(void) +{ + return &debug_level; +} +#endif /* TEST_BUILD */ |