summaryrefslogtreecommitdiff
path: root/include/mock/usb_tc_sm_mock.h
diff options
context:
space:
mode:
authorPaul Fagerburg <pfagerburg@google.com>2020-08-14 17:20:04 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-31 17:06:13 +0000
commit33db71602297092026bb714f8b038ac0e7ac593d (patch)
tree4f40eb0fbcc63acd5d8f4387f7d2d554f80ae6b4 /include/mock/usb_tc_sm_mock.h
parentbd018841f6f2856c949dcf9b6dd462872cd18d7f (diff)
downloadchrome-ec-33db71602297092026bb714f8b038ac0e7ac593d.tar.gz
usb_pe_drp: new unit test with mocks
Add a new unit test for usb_pe_drp with mocks for the various subsystems that it will use. The fake_prl module is already essentially a mock for the PRL layer, so just move it into the mocks directory and make it available as mock to other tests. BUG=b:163421994 BRANCH=None TEST=`make runhosttests` succeeds Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: I2aea3fa0694e8d9e6bae1f47516cb4d5d2a1e714 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2364050 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'include/mock/usb_tc_sm_mock.h')
-rw-r--r--include/mock/usb_tc_sm_mock.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mock/usb_tc_sm_mock.h b/include/mock/usb_tc_sm_mock.h
index dfead9ee8c..78875139ba 100644
--- a/include/mock/usb_tc_sm_mock.h
+++ b/include/mock/usb_tc_sm_mock.h
@@ -19,6 +19,8 @@ struct mock_tc_port_t {
int msg_rx_id;
enum tcpm_transmit_type sop;
enum tcpc_rp_value lcl_rp;
+ int attached_snk;
+ int attached_src;
};
extern struct mock_tc_port_t mock_tc_port[CONFIG_USB_PD_PORT_MAX_COUNT];