mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
selftests: harness: avoid false negatives if test has no ASSERTs
[ Upstream commit3abedf4646
] Test can fail either immediately when ASSERT() failed or at the end if one or more EXPECT() was not met. The exact return code is decided based on the number of successful ASSERT()s. If test has no ASSERT()s, however, the return code will be 0, as if the test did not fail. Start counting ASSERT()s from 1. Fixes:369130b631
("selftests: Enhance kselftest_harness.h to print which assert failed") Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
01a483ff6d
commit
dbc54d565a
1 changed files with 1 additions and 1 deletions
|
@ -969,7 +969,7 @@ void __run_test(struct __fixture_metadata *f,
|
|||
t->passed = 1;
|
||||
t->skip = 0;
|
||||
t->trigger = 0;
|
||||
t->step = 0;
|
||||
t->step = 1;
|
||||
t->no_print = 0;
|
||||
memset(t->results->reason, 0, sizeof(t->results->reason));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue