From: Arnaldo Carvalho de Melo Date: Thu, 22 Feb 2024 20:07:20 +0000 (-0300) Subject: perf test: Use TEST_FAIL in the TEST_ASSERT macros instead of -1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8680999dbe5735a68feae396dcfc486e18679f2e;p=linux.git 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 Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/ZdepeMsjagbf1ufD@x1 --- diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index dad3d7414142d..3aa7701ee0e93 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -4,11 +4,17 @@ #include +enum { + TEST_OK = 0, + TEST_FAIL = -1, + TEST_SKIP = -2, +}; + #define TEST_ASSERT_VAL(text, cond) \ do { \ if (!(cond)) { \ pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \ - return -1; \ + return TEST_FAIL; \ } \ } while (0) @@ -17,16 +23,10 @@ do { \ if (val != expected) { \ pr_debug("FAILED %s:%d %s (%d != %d)\n", \ __FILE__, __LINE__, text, val, expected); \ - return -1; \ + return TEST_FAIL; \ } \ } while (0) -enum { - TEST_OK = 0, - TEST_FAIL = -1, - TEST_SKIP = -2, -}; - struct test_suite; typedef int (*test_fnptr)(struct test_suite *, int);