summaryrefslogtreecommitdiff
path: root/test/usb_sm_checks.h
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-08-07 12:49:34 -0600
committerCommit Bot <commit-bot@chromium.org>2019-08-20 16:05:47 +0000
commit7a07137ff8861509b5942a82de1c46b376c6057a (patch)
tree40ec190a005c76d7be409ac20367486270e7b848 /test/usb_sm_checks.h
parent72405bceb4f8234ad1dc4a64041c0037abd57a21 (diff)
downloadchrome-ec-7a07137ff8861509b5942a82de1c46b376c6057a.tar.gz
test: add sanity check for existing state machines
We want to ensure that our usb state machines - do not have any cycles - do not have any completely empty states - have names for every print statement if called These new unit tests allow us to have build-times checks for the above. BRANCH=none BUG=none TEST=tests pass. Made each test fail locally to ensure that tests were actually working. Change-Id: Idd2c4d69e83cf38c97278edd1727d86b52a85db9 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744657 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'test/usb_sm_checks.h')
-rw-r--r--test/usb_sm_checks.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/usb_sm_checks.h b/test/usb_sm_checks.h
new file mode 100644
index 0000000000..0a556518a4
--- /dev/null
+++ b/test/usb_sm_checks.h
@@ -0,0 +1,25 @@
+/* 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.
+ */
+
+/* Sanity tests for a state machine definition */
+
+#ifndef __CROS_EC_USB_SM_CHECKS_H
+#define __CROS_EC_USB_SM_CHECKS_H
+
+int test_tc_no_parent_cycles(void);
+int test_tc_no_empty_state(void);
+int test_tc_all_states_named(void);
+
+
+int test_prl_no_parent_cycles(void);
+int test_prl_no_empty_state(void);
+int test_prl_all_states_named(void);
+
+
+int test_pe_no_parent_cycles(void);
+int test_pe_no_empty_state(void);
+int test_pe_all_states_named(void);
+
+#endif /* __CROS_EC_USB_SM_CHECKS_H */ \ No newline at end of file