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

From: Masami Hiramatsu
Date: Mon Apr 25 2016 - 17:33:26 EST


On Sat, 23 Apr 2016 14:45:54 +0100
Colin King <colin.king@xxxxxxxxxxxxx> wrote:

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> 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
>

Looks good to me.

Reviewed-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>

> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> ---
> 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
>


--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>