diff options
author | Jett Rink <jettrink@chromium.org> | 2020-02-05 10:16:10 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-05 20:29:07 +0000 |
commit | 678b6f1237a83b642de2356a20eee55da85ae38b (patch) | |
tree | e90dd990b4cd74e656eca577dceefb830a549b0e /common | |
parent | 1f3f4e74576669a1c791cbb1d45bbd3a410a085d (diff) | |
download | chrome-ec-678b6f1237a83b642de2356a20eee55da85ae38b.tar.gz |
test: move mock header files
Move header files for mocks into the include/mocks folder. These header
files aren't just private to the common/mock implementation as the test/
files also need access to these defines.
BRANCH=none
BUG=none
TEST=buildall
Change-Id: I25d03d194ab46b7665f54175979577aa90af814f
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2039038
Commit-Queue: Craig Hesling <hesling@chromium.org>
Reviewed-by: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/mock/tcpc_mock.c | 2 | ||||
-rw-r--r-- | common/mock/tcpc_mock.h | 25 | ||||
-rw-r--r-- | common/mock/usb_mux_mock.c | 2 | ||||
-rw-r--r-- | common/mock/usb_mux_mock.h | 19 |
4 files changed, 2 insertions, 46 deletions
diff --git a/common/mock/tcpc_mock.c b/common/mock/tcpc_mock.c index dabe5cda70..4a9b21b5cc 100644 --- a/common/mock/tcpc_mock.c +++ b/common/mock/tcpc_mock.c @@ -7,7 +7,7 @@ #include "common.h" #include "console.h" #include "usb_pd_tcpm.h" -#include "tcpc_mock.h" +#include "mock/tcpc_mock.h" #include "memory.h" /* Public API for controlling/inspecting this mock */ diff --git a/common/mock/tcpc_mock.h b/common/mock/tcpc_mock.h deleted file mode 100644 index 0cea10412a..0000000000 --- a/common/mock/tcpc_mock.h +++ /dev/null @@ -1,25 +0,0 @@ -/* 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. - */ - /* Mock for the TCPC interface */ - -#include "usb_pd_tcpm.h" -#include "usb_pd.h" - -/* Controller for TCPC state */ -struct mock_tcpc_ctrl { - enum tcpc_cc_voltage_status cc1; - enum tcpc_cc_voltage_status cc2; - int vbus_level; - enum pd_power_role power_role; - enum pd_data_role data_role; - int num_calls_to_set_header; - int should_print_header_changes; -}; - -/* Reset this TCPC mock */ -void mock_tcpc_reset(void); - -extern const struct tcpm_drv mock_tcpc_driver; -extern struct mock_tcpc_ctrl mock_tcpc; diff --git a/common/mock/usb_mux_mock.c b/common/mock/usb_mux_mock.c index 28f07c54f7..c64c5cad0b 100644 --- a/common/mock/usb_mux_mock.c +++ b/common/mock/usb_mux_mock.c @@ -7,7 +7,7 @@ #include "common.h" #include "console.h" #include "usb_mux.h" -#include "usb_mux_mock.h" +#include "mock/usb_mux_mock.h" #include "memory.h" /* Public API for controlling/inspecting this mock */ diff --git a/common/mock/usb_mux_mock.h b/common/mock/usb_mux_mock.h deleted file mode 100644 index 128286796b..0000000000 --- a/common/mock/usb_mux_mock.h +++ /dev/null @@ -1,19 +0,0 @@ -/* 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. - */ -/* Mock USB Type-C mux */ - -#include "usb_mux.h" - -/* Controller for mux state */ -struct mock_usb_mux_ctrl { - mux_state_t state; - int num_set_calls; -}; - -/* Resets the state of the mock */ -void mock_usb_mux_reset(void); - -extern const struct usb_mux_driver mock_usb_mux_driver; -extern struct mock_usb_mux_ctrl mock_usb_mux; |