Skip to contentSkip to conversation

selftests: bpf: fix backported ASSERT_FALSE

PATCH New Lorenz Bauer 1 participant 1 message Oct 25, 2021 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: bpf: fix backported ASSERT_FALSE

Commit 183d9ebd449c ("selftests/bpf: Fix core_reloc test runner") causes builds of selftests/bpf to fail on 5.10.y since the branch doesn't have the ASSERT_FALSE macro yet. Replace ASSERT_FALSE with ASSERT_EQ.

Fixes 183d9ebd449c ("selftests/bpf: Fix core_reloc test runner")
---
 tools/testing/selftests/bpf/prog_tests/core_reloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/core_reloc.c +1 -1
index 8b641c306f26..5b52985cb60e 100644
@@ -857,7 +857,7 @@ void test_core_reloc(void)
 			goto cleanup;
 		}
 
-		if (!ASSERT_FALSE(test_case->fails, "obj_load_should_fail"))
+		if (!ASSERT_EQ(test_case->fails, false, "obj_load_should_fail"))
 			goto cleanup;
 
 		equal = memcmp(data->out, test_case->output,
Signature · 1 line
2.32.0