Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1385677

[PATCH] perf tools: replace assignment with comparison on assert check

From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH] perf tools: replace assignment with comparison on assert check
Date 2016-04-23 15:50 +0200
Message-ID <rr66B-3Ns-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Colin Ian King <colin.king@canonical.com>

The current assert check is checking an assignment, which will always
be true.  Instead, the assert should be checking if scale is equal
to 0.122

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 tools/perf/tests/event_update.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
index 012eab5..63ecf21 100644
--- a/tools/perf/tests/event_update.c
+++ b/tools/perf/tests/event_update.c
@@ -30,7 +30,7 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused,
 
 	TEST_ASSERT_VAL("wrong id", ev->id == 123);
 	TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__SCALE);
-	TEST_ASSERT_VAL("wrong scale", ev_data->scale = 0.123);
+	TEST_ASSERT_VAL("wrong scale", ev_data->scale == 0.123);
 	return 0;
 }
 
-- 
2.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] perf tools: replace assignment with comparison on assert check Colin King <colin.king@canonical.com> - 2016-04-23 15:50 +0200
  Re: [PATCH] perf tools: replace assignment with comparison on  assert check Masami Hiramatsu <mhiramat@kernel.org> - 2016-04-25 23:40 +0200
  [tip:perf/core] perf tests: Replace assignment with comparison on  assert check tip-bot for Colin Ian King <tipbot@zytor.com> - 2016-04-27 17:40 +0200

csiph-web