summaryrefslogtreecommitdiff
path: root/test/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/common.c')
-rw-r--r--test/common.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/common.c b/test/common.c
index 2ea2e5b..6d6f25e 100644
--- a/test/common.c
+++ b/test/common.c
@@ -55,11 +55,10 @@
* See below for examples.
*/
int
-test_key_seq(struct xkb_keymap *keymap, ...)
+test_key_seq_va(struct xkb_keymap *keymap, va_list ap)
{
struct xkb_state *state;
- va_list ap;
xkb_keycode_t kc;
int op;
xkb_keysym_t keysym;
@@ -73,8 +72,6 @@ test_key_seq(struct xkb_keymap *keymap, ...)
state = xkb_state_new(keymap);
assert(state);
- va_start(ap, keymap);
-
for (;;) {
kc = va_arg(ap, int) + EVDEV_OFFSET;
op = va_arg(ap, int);
@@ -120,16 +117,27 @@ test_key_seq(struct xkb_keymap *keymap, ...)
goto fail;
}
- va_end(ap);
xkb_state_unref(state);
return 1;
fail:
- va_end(ap);
xkb_state_unref(state);
return 0;
}
+int
+test_key_seq(struct xkb_keymap *keymap, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start(ap, keymap);
+ ret = test_key_seq_va(keymap, ap);
+ va_end(ap);
+
+ return ret;
+}
+
const char *
test_get_path(const char *path_rel)
{