summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2020-02-28 10:36:16 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-03-09 21:43:25 -0300
commitd942815a76463fa53b81d3d1c064f76bb3f80ead (patch)
tree1093c14b0055977bfbb1319625eaa13c6c72864e /tools/perf/tests
parent0f9b1e124bb29719eb1572db74b7893bd616f938 (diff)
downloadlinux-d942815a76463fa53b81d3d1c064f76bb3f80ead.tar.gz
linux-d942815a76463fa53b81d3d1c064f76bb3f80ead.tar.bz2
linux-d942815a76463fa53b81d3d1c064f76bb3f80ead.zip
perf expr: Make expr__parse() return -1 on error
To match the error value of the expr__find_other function, so all exported expr functions return the same values: 0 on success, -1 on error. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Reviewed-by: Andi Kleen <ak@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: John Garry <john.garry@huawei.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Link: http://lore.kernel.org/lkml/20200228093616.67125-6-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r--tools/perf/tests/expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
index 755d73c86c68..28313e59d6f6 100644
--- a/tools/perf/tests/expr.c
+++ b/tools/perf/tests/expr.c
@@ -45,11 +45,11 @@ int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
p = "FOO/0";
ret = expr__parse(&val, &ctx, p);
- TEST_ASSERT_VAL("division by zero", ret == 1);
+ TEST_ASSERT_VAL("division by zero", ret == -1);
p = "BAR/";
ret = expr__parse(&val, &ctx, p);
- TEST_ASSERT_VAL("missing operand", ret == 1);
+ TEST_ASSERT_VAL("missing operand", ret == -1);
TEST_ASSERT_VAL("find other",
expr__find_other("FOO + BAR + BAZ + BOZO", "FOO", &other, &num_other) == 0);