summaryrefslogtreecommitdiff
path: root/test/usb_typec_ctvpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/usb_typec_ctvpd.c')
-rw-r--r--test/usb_typec_ctvpd.c52
1 files changed, 34 insertions, 18 deletions
diff --git a/test/usb_typec_ctvpd.c b/test/usb_typec_ctvpd.c
index 2d45b4f882..8c8b5e3897 100644
--- a/test/usb_typec_ctvpd.c
+++ b/test/usb_typec_ctvpd.c
@@ -15,6 +15,7 @@
#include "util.h"
#include "usb_pd_tcpm.h"
#include "usb_pd_test_util.h"
+#include "usb_sm_checks.h"
#include "vpd_api.h"
#define PORT0 0
@@ -658,9 +659,9 @@ static int test_ctvpd_behavior_case1(void)
/*
* CASE 1: The following tests the behavior when a DRP is connected to a
- * Charge-Through VCONN-Powered USB Device (abbreviated CTVPD),
- * with no Power Source attached to the ChargeThrough port on
- * the CTVPD.
+ * Charge-Through VCONN-Powered USB Device (abbreviated CTVPD),
+ * with no Power Source attached to the ChargeThrough port on
+ * the CTVPD.
*/
/* 1. DRP and CTVPD are both in the unattached state */
@@ -797,9 +798,9 @@ static int test_ctvpd_behavior_case2(void)
/*
* CASE 2: The following tests the behavior when a Power Source is
- * connected to a Charge-Through VCONN-Powered USB Device
- * (abbreviated CTVPD), with a Host already attached to the
- * Host-Side port on the CTVPD.
+ * connected to a Charge-Through VCONN-Powered USB Device
+ * (abbreviated CTVPD), with a Host already attached to the
+ * Host-Side port on the CTVPD.
*/
/*
@@ -919,9 +920,9 @@ static int test_ctvpd_behavior_case3(void)
/*
* CASE 3: The following describes the behavior when a Power Source is
- * connected to a ChargeThrough VCONN-Powered USB Device
- * (abbreviated CTVPD), with no Host attached to the Host-side
- * port on the CTVPD.
+ * connected to a ChargeThrough VCONN-Powered USB Device
+ * (abbreviated CTVPD), with no Host attached to the Host-side
+ * port on the CTVPD.
*/
/*
@@ -1022,9 +1023,9 @@ static int test_ctvpd_behavior_case4(void)
/*
* CASE 4: The following describes the behavior when a DRP is connected
- * to a Charge-Through VCONN-Powered USB Device
- * (abbreviated CTVPD), with a Power Source already attached to
- * the Charge-Through side on the CTVPD.
+ * to a Charge-Through VCONN-Powered USB Device
+ * (abbreviated CTVPD), with a Power Source already attached to
+ * the Charge-Through side on the CTVPD.
*/
/*
@@ -1177,9 +1178,9 @@ static int test_ctvpd_behavior_case5(void)
/*
* CASE 5: The following describes the behavior when a Power Source is
- * connected to a ChargeThrough VCONN-Powered USB Device
- * (abbreviated CTVPD), with a DRP (with dead battery) attached
- * to the Host-side port on the CTVPD.
+ * connected to a ChargeThrough VCONN-Powered USB Device
+ * (abbreviated CTVPD), with a DRP (with dead battery) attached
+ * to the Host-side port on the CTVPD.
*/
/*
@@ -1317,9 +1318,9 @@ static int test_ctvpd_behavior_case6(void)
/*
* CASE 6: The following describes the behavior when a DRP is connected
- * to a Charge-Through VCONN-Powered USB Device
- * (abbreviated CTVPD) and a Sink is attached to the
- * Charge-Through port on the CTVPD.
+ * to a Charge-Through VCONN-Powered USB Device
+ * (abbreviated CTVPD) and a Sink is attached to the
+ * Charge-Through port on the CTVPD.
*/
/*
@@ -1513,6 +1514,21 @@ void run_test(void)
RUN_TEST(test_ctvpd_behavior_case5);
RUN_TEST(test_ctvpd_behavior_case6);
#endif
+
+ /* Do basic state machine sanity checks last. */
+ RUN_TEST(test_tc_no_parent_cycles);
+ RUN_TEST(test_tc_no_empty_state);
+ RUN_TEST(test_tc_all_states_named);
+
+ /*
+ * Since you have to include TypeC layer when adding PE layer, the
+ * PE test would have the same build dependencies, so go ahead and test
+ * te PE statemachine here so we don't have to create another test exe
+ */
+ RUN_TEST(test_pe_no_parent_cycles);
+ RUN_TEST(test_pe_no_empty_state);
+ RUN_TEST(test_pe_all_states_named);
+
test_print_result();
}