diff options
author | Bobby Casey <bobbycasey@google.com> | 2022-07-06 15:03:00 -0400 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-07 21:04:43 +0000 |
commit | 7eab3811962cde5b5c66a5952a4f7d9b1b41cd67 (patch) | |
tree | 0e5cedc280b63fe3c63748049da1f236707ac4c7 /test/kb_8042.c | |
parent | 9a3c514b45976907b9bb566cf8eabf1c53a3f040 (diff) | |
download | chrome-ec-7eab3811962cde5b5c66a5952a4f7d9b1b41cd67.tar.gz |
test: Remove TEST_CHECK macro
The TEST_CHECK macro returns a value (from the calling function) on
either success or failure. This differs from all other TEST_* macros in
test_util.h, which only return on failure. Returning on failure is
appropriate and allows short circuiting a test on the first failure but
returning on success results in short circuiting after the first
successful check and bypassing subsequent checks. This behavior
is somewhat confusing and easy to miss during review.
BRANCH=none
BUG=b:238120333
TEST=make runhosttests
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Bobby Casey <bobbycasey@google.com>
Change-Id: I3777b427aa5e20a91689f86fc37daadffacf27f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3748830
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'test/kb_8042.c')
-rw-r--r-- | test/kb_8042.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/kb_8042.c b/test/kb_8042.c index 0bd0c273c4..1a3681aa28 100644 --- a/test/kb_8042.c +++ b/test/kb_8042.c @@ -114,7 +114,8 @@ static int __verify_no_char(void) { lpc_char_cnt = 0; msleep(30); - TEST_CHECK(lpc_char_cnt == 0); + TEST_ASSERT(lpc_char_cnt == 0); + return EC_SUCCESS; } #define VERIFY_NO_CHAR() TEST_ASSERT(__verify_no_char() == EC_SUCCESS) |