summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@kernel.org>2024-02-22 17:07:20 -0300
committerNamhyung Kim <namhyung@kernel.org>2024-02-26 08:31:24 -0800
commit8680999dbe5735a68feae396dcfc486e18679f2e (patch)
tree1b7297e2bb988dcad31126b94c3f8ee2068e5797
parentbae4d1f86e4d6750d2fc11e040c7d49b180c4b8d (diff)
downloadlinux-stable-8680999dbe5735a68feae396dcfc486e18679f2e.tar.gz
linux-stable-8680999dbe5735a68feae396dcfc486e18679f2e.tar.bz2
linux-stable-8680999dbe5735a68feae396dcfc486e18679f2e.zip
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
-rw-r--r--tools/perf/tests/tests.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index dad3d7414142..3aa7701ee0e9 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -4,11 +4,17 @@
#include <stdbool.h>
+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);