perf test: Add expr test for events with hyphens

Bugzilla: https://bugzilla.redhat.com/2069073

upstream
========
commit 604ce2f00465efdf6efa9708c0b9b1fc302f46f0
Author: Ian Rogers <irogers@google.com>
Date: Wed Nov 10 16:21:02 2021 -0800

description
===========
An example of such an event is topdown-fe-bound.

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
This commit is contained in:
Michael Petlan 2022-05-03 21:59:45 +02:00
parent 76411fbaeb
commit 15ec41274b
1 changed files with 10 additions and 0 deletions

View File

@ -134,6 +134,16 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "EVENT2,param=3@",
(void **)&val_ptr));
expr__ctx_clear(ctx);
TEST_ASSERT_VAL("find ids",
expr__find_ids("dash\\-event1 - dash\\-event2",
NULL, ctx) == 0);
TEST_ASSERT_VAL("find ids", hashmap__size(ctx->ids) == 2);
TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "dash-event1",
(void **)&val_ptr));
TEST_ASSERT_VAL("find ids", hashmap__find(ctx->ids, "dash-event2",
(void **)&val_ptr));
/* Only EVENT1 or EVENT2 need be measured depending on the value of smt_on. */
expr__ctx_clear(ctx);
TEST_ASSERT_VAL("find ids",