diff options
Diffstat (limited to 'fuzz')
-rw-r--r-- | fuzz/fuzz_config.h | 3 | ||||
-rw-r--r-- | fuzz/usb_tcpm_v2_fuzz.c | 18 | ||||
-rw-r--r-- | fuzz/usb_tcpm_v2_fuzz.mocklist | 7 |
3 files changed, 22 insertions, 6 deletions
diff --git a/fuzz/fuzz_config.h b/fuzz/fuzz_config.h index 5e7c819359..61aacb7660 100644 --- a/fuzz/fuzz_config.h +++ b/fuzz/fuzz_config.h @@ -50,7 +50,10 @@ #define CONFIG_USB_POWER_DELIVERY #define CONFIG_USB_PRL_SM #define CONFIG_USB_PD_TCPMV2 +#define CONFIG_USB_PD_DECODE_SOP #define CONFIG_USB_DRP_ACC_TRYSRC +#define CONFIG_USB_PD_ALT_MODE_DFP +#define CONFIG_USBC_SS_MUX #define CONFIG_USBC_VCONN #define CONFIG_USBC_VCONN_SWAP #define PD_VCONN_SWAP_DELAY 5000 diff --git a/fuzz/usb_tcpm_v2_fuzz.c b/fuzz/usb_tcpm_v2_fuzz.c index d4e89fd118..d4f91aba8d 100644 --- a/fuzz/usb_tcpm_v2_fuzz.c +++ b/fuzz/usb_tcpm_v2_fuzz.c @@ -6,8 +6,9 @@ */ #define HIDE_EC_STDLIB -#include "usb_pd.h" #include "charge_manager.h" +#include "mock/usb_mux_mock.h" +#include "usb_pd.h" const struct svdm_response svdm_rsp = { .identity = NULL, @@ -15,12 +16,17 @@ const struct svdm_response svdm_rsp = { .modes = NULL, }; +/* USB mux configuration */ +const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { + { + .driver = &mock_usb_mux_driver, + }, + { + .driver = &mock_usb_mux_driver, + } +}; + int pd_check_vconn_swap(int port) { return 1; } - -void dfp_consume_cable_response(int port, int cnt, uint32_t *payload, - uint16_t head) -{ -} diff --git a/fuzz/usb_tcpm_v2_fuzz.mocklist b/fuzz/usb_tcpm_v2_fuzz.mocklist new file mode 100644 index 0000000000..1b2c615371 --- /dev/null +++ b/fuzz/usb_tcpm_v2_fuzz.mocklist @@ -0,0 +1,7 @@ +/* Copyright 2020 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. + */ + + #define CONFIG_TEST_MOCK_LIST \ + MOCK(USB_MUX) |