Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Use TEST_FAIL in the TEST_ASSERT macros instead of -1

Just to make things clearer, return TEST_FAIL (-1) instead of an open
coded -1.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/ZdepeMsjagbf1ufD@x1

authored by

Arnaldo Carvalho de Melo and committed by
Namhyung Kim
8680999d bae4d1f8

+8 -8
+8 -8
tools/perf/tests/tests.h
··· 4 4 5 5 #include <stdbool.h> 6 6 7 + enum { 8 + TEST_OK = 0, 9 + TEST_FAIL = -1, 10 + TEST_SKIP = -2, 11 + }; 12 + 7 13 #define TEST_ASSERT_VAL(text, cond) \ 8 14 do { \ 9 15 if (!(cond)) { \ 10 16 pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \ 11 - return -1; \ 17 + return TEST_FAIL; \ 12 18 } \ 13 19 } while (0) 14 20 ··· 23 17 if (val != expected) { \ 24 18 pr_debug("FAILED %s:%d %s (%d != %d)\n", \ 25 19 __FILE__, __LINE__, text, val, expected); \ 26 - return -1; \ 20 + return TEST_FAIL; \ 27 21 } \ 28 22 } while (0) 29 - 30 - enum { 31 - TEST_OK = 0, 32 - TEST_FAIL = -1, 33 - TEST_SKIP = -2, 34 - }; 35 23 36 24 struct test_suite; 37 25