summaryrefslogtreecommitdiff
path: root/common/usbc/usb_tc_vpd_sm.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usbc/usb_tc_vpd_sm.c')
-rw-r--r--common/usbc/usb_tc_vpd_sm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/common/usbc/usb_tc_vpd_sm.c b/common/usbc/usb_tc_vpd_sm.c
index 1abbf7d4f2..1b72c207e8 100644
--- a/common/usbc/usb_tc_vpd_sm.c
+++ b/common/usbc/usb_tc_vpd_sm.c
@@ -159,7 +159,7 @@ test_export_static enum usb_tc_state get_state_tc(const int port)
return tc[port].ctx.current - &tc_states[0];
}
-static void print_current_state(const int port)
+test_mockable_static void print_current_state(const int port)
{
CPRINTS("C%d: %s", port, tc_state_names[get_state_tc(port)]);
}
@@ -398,3 +398,15 @@ static const struct usb_state tc_states[] = {
.exit = tc_attached_snk_exit,
},
};
+
+#ifdef TEST_BUILD
+const struct test_sm_data test_tc_sm_data[] = {
+ {
+ .base = tc_states,
+ .size = ARRAY_SIZE(tc_states),
+ .names = tc_state_names,
+ .names_size = ARRAY_SIZE(tc_state_names),
+ },
+};
+const int test_tc_sm_data_size = ARRAY_SIZE(test_tc_sm_data);
+#endif