summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJan Dabros <jsd@semihalf.com>2020-05-14 13:40:32 +0200
committerCommit Bot <commit-bot@chromium.org>2020-05-18 16:56:47 +0000
commit983a7db44cbfd0bf8eceaee92c0a6c42d4477375 (patch)
tree26895a313faf8823829e8972a2a57d610b6947f5 /test
parent400ea24bb0d0103f04749a5508de755ce544f467 (diff)
downloadchrome-ec-983a7db44cbfd0bf8eceaee92c0a6c42d4477375.tar.gz
test: Change init condition for test_polarity_cc1_default
BUG=none BRANCH=none TEST=Run usb_typec_drp_acc_trysrc host test Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I65b57f667efb4ee5ed3c106543cd7492bb69a0bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2203062 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/usb_typec_drp_acc_trysrc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/usb_typec_drp_acc_trysrc.c b/test/usb_typec_drp_acc_trysrc.c
index 375ea9364f..34e356e884 100644
--- a/test/usb_typec_drp_acc_trysrc.c
+++ b/test/usb_typec_drp_acc_trysrc.c
@@ -162,6 +162,14 @@ __maybe_unused static int test_polarity_cc1_default(void)
mock_tcpc.cc1 = TYPEC_CC_VOLT_RP_DEF;
mock_tcpc.cc2 = TYPEC_CC_VOLT_OPEN;
mock_tcpc.vbus_level = 1;
+
+ /*
+ * In this test we are expecting value of polarity, which is set by
+ * default for tcpc mock. Initialize it with something else, in order
+ * to catch possible errors.
+ */
+ mock_tcpc.last.polarity = POLARITY_COUNT;
+
task_set_event(TASK_ID_PD_C0, PD_EVENT_CC, 0);
/* Before tCCDebounce elapses, we should SRC */