From: Daniel Stone Date: Thu, 12 Jul 2012 23:32:41 +0000 (+0100) Subject: rulescomp: Fix benchmark runs X-Git-Tag: xkbcommon-0.2.0~458 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a19abd26359aa090cf4abf71122e2ab61c89065c;p=platform%2Fupstream%2Flibxkbcommon.git rulescomp: Fix benchmark runs We'd accidentally inverted silent vs. non-silent compilation, which would skew the benchmark pretty badly, but also forgot to change base to evdev for the rules here. Signed-off-by: Daniel Stone --- diff --git a/test/rulescomp.c b/test/rulescomp.c index 1c084e2..6a5fcf1 100644 --- a/test/rulescomp.c +++ b/test/rulescomp.c @@ -43,8 +43,11 @@ test_rmlvo(struct xkb_context *context, const char *rules, keymap = test_compile_rules(context, rules, model, layout, variant, options); - if (keymap) + if (keymap) { + fprintf(stderr, "Compiled '%s' '%s' '%s' '%s' '%s'\n", + rules, model, layout, variant, options); xkb_map_unref(keymap); + } return keymap != NULL; } @@ -58,11 +61,8 @@ test_rmlvo_silent(struct xkb_context *context, const char *rules, keymap = test_compile_rules(context, rules, model, layout, variant, options); - if (keymap) { - fprintf(stderr, "Compiled '%s' '%s' '%s' '%s' '%s'\n", - rules, model, layout, variant, options); + if (keymap) xkb_map_unref(keymap); - } return keymap != NULL; } @@ -75,7 +75,7 @@ benchmark(struct xkb_context *context) clock_gettime(CLOCK_MONOTONIC, &start); for (i = 0; i < BENCHMARK_ITERATIONS; i++) - assert(test_rmlvo_silent(context, "base", "", "us", "", "")); + assert(test_rmlvo_silent(context, "evdev", "", "us", "", "")); clock_gettime(CLOCK_MONOTONIC, &stop); elapsed.tv_sec = stop.tv_sec - start.tv_sec;