[PATCH 1/7] perf test: Check result of has_event(cycles) test

From: James Clark
Date: Thu Aug 31 2023 - 11:17:10 EST


Currently the function always returns 0, so even when the has_event()
test fails, the test still passes. Fix it by returning ret instead.

Signed-off-by: James Clark <james.clark@xxxxxxx>
---
tools/perf/tests/expr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
index 81229fa4f1e9..39be7f3b3a53 100644
--- a/tools/perf/tests/expr.c
+++ b/tools/perf/tests/expr.c
@@ -263,7 +263,7 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u

expr__ctx_free(ctx);

- return 0;
+ return ret;
}

DEFINE_SUITE("Simple expression parser", expr);
--
2.34.1