diff options
author | Jett Rink <jettrink@chromium.org> | 2019-08-08 09:35:54 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-20 16:05:48 +0000 |
commit | 6d8a5d3f207af7481e2aa114d306f8448d21b74f (patch) | |
tree | 6973f68a16c250eec28f05562e341d03d52ccd59 /test/usb_typec_drp_acc_trysrc.c | |
parent | 7a07137ff8861509b5942a82de1c46b376c6057a (diff) | |
download | chrome-ec-6d8a5d3f207af7481e2aa114d306f8448d21b74f.tar.gz |
test: add baseline test for TC_DRP_TRYSRC SM
BRANCH=none
BUG=none
TEST=unit test pass
Change-Id: I0ecb9f0298fd43ca0db800311a309d98eb1e29b5
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744658
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'test/usb_typec_drp_acc_trysrc.c')
-rw-r--r-- | test/usb_typec_drp_acc_trysrc.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/usb_typec_drp_acc_trysrc.c b/test/usb_typec_drp_acc_trysrc.c new file mode 100644 index 0000000000..ffc2a896c3 --- /dev/null +++ b/test/usb_typec_drp_acc_trysrc.c @@ -0,0 +1,32 @@ +/* Copyright 2019 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Test USB Type-C VPD and CTVPD module. + */ +#include "task.h" +#include "timer.h" +#include "test_util.h" +#include "usb_sm_checks.h" +#include "charge_manager.h" + +void charge_manager_set_ceil(int port, enum ceil_requestor requestor, int ceil) +{ + /* Do Nothing, but needed for linking */ +} + +void run_test(void) +{ + test_reset(); + + /* Ensure that PD task initializes its state machine */ + task_wake(TASK_ID_PD_C0); + task_wait_event(5 * MSEC); + + /* Do basic state machine sanity checks last. */ + RUN_TEST(test_tc_no_parent_cycles); + RUN_TEST(test_tc_no_empty_state); + RUN_TEST(test_tc_all_states_named); + + test_print_result(); +} |