tests/kernel/common: Fix dead code in sflist test

An inverted comparison typo led to the final loop in the sflist being
skipped.  Fix so that it actually runs.

(Odd that it took a static analysis tool to detect this, the loop
expressions are all constants, I'm surprised gcc didn't see it while
doing unrolling analysis).

Fixes #18437

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2019-08-21 16:36:34 -07:00 committed by Anas Nashif
commit 8cdbd1cd0b

View file

@ -404,7 +404,7 @@ void test_sflist(void)
sys_sfnode_flags_set(node, 3 - ii);
sys_sflist_append(&test_list, node);
}
for (ii = 3; ii <= 0; ii--) {
for (ii = 3; ii >= 0; ii--) {
node = sys_sflist_get(&test_list);
zassert_equal(sys_sfnode_flags_get(node), ii,
"wrong flags value");