Skip to content

Commit b0500c1

Browse files
WangNan0acmel
authored andcommitted
perf test: Reset err after using it hold errcode in hist testcases
All hists test cases forget to reset err after using it to hold an error code. If error occure in setup_fake_machine() it incorrectly return TEST_OK. This patch fixes it. Suggested-and-Acked-by: Namhyung Kim <[email protected]> Signed-off-by: Wang Nan <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Zefan Li <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 71b3ee7 commit b0500c1

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

tools/perf/tests/hists_cumulate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ int test__hists_cumulate(int subtest __maybe_unused)
706706
err = parse_events(evlist, "cpu-clock", NULL);
707707
if (err)
708708
goto out;
709+
err = TEST_FAIL;
709710

710711
machines__init(&machines);
711712

tools/perf/tests/hists_filter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ int test__hists_filter(int subtest __maybe_unused)
120120
err = parse_events(evlist, "task-clock", NULL);
121121
if (err)
122122
goto out;
123+
err = TEST_FAIL;
123124

124125
/* default sort order (comm,dso,sym) will be used */
125126
if (setup_sorting(NULL) < 0)

tools/perf/tests/hists_link.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ int test__hists_link(int subtest __maybe_unused)
293293
if (err)
294294
goto out;
295295

296+
err = TEST_FAIL;
296297
/* default sort order (comm,dso,sym) will be used */
297298
if (setup_sorting(NULL) < 0)
298299
goto out;

tools/perf/tests/hists_output.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ int test__hists_output(int subtest __maybe_unused)
597597
err = parse_events(evlist, "cpu-clock", NULL);
598598
if (err)
599599
goto out;
600+
err = TEST_FAIL;
600601

601602
machines__init(&machines);
602603

0 commit comments

Comments
 (0)