Skip to content

Commit

Permalink
perf test: Reset err after using it hold errcode in hist testcases
Browse files Browse the repository at this point in the history
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 <namhyung@kernel.org>
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1452520124-2073-13-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Wang Nan authored and Arnaldo Carvalho de Melo committed Jan 11, 2016
1 parent 71b3ee7 commit b0500c1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/tests/hists_cumulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ int test__hists_cumulate(int subtest __maybe_unused)
err = parse_events(evlist, "cpu-clock", NULL);
if (err)
goto out;
err = TEST_FAIL;

machines__init(&machines);

Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/hists_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ int test__hists_filter(int subtest __maybe_unused)
err = parse_events(evlist, "task-clock", NULL);
if (err)
goto out;
err = TEST_FAIL;

/* default sort order (comm,dso,sym) will be used */
if (setup_sorting(NULL) < 0)
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/hists_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ int test__hists_link(int subtest __maybe_unused)
if (err)
goto out;

err = TEST_FAIL;
/* default sort order (comm,dso,sym) will be used */
if (setup_sorting(NULL) < 0)
goto out;
Expand Down
1 change: 1 addition & 0 deletions tools/perf/tests/hists_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ int test__hists_output(int subtest __maybe_unused)
err = parse_events(evlist, "cpu-clock", NULL);
if (err)
goto out;
err = TEST_FAIL;

machines__init(&machines);

Expand Down

0 comments on commit b0500c1

Please sign in to comment.