mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
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
This commit is contained in:
committed by
Namhyung Kim
parent
bae4d1f86e
commit
8680999dbe
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user