summaryrefslogtreecommitdiff
path: root/test/x11comp.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2015-08-23 22:22:11 +0300
committerRan Benita <ran234@gmail.com>2015-08-23 23:16:23 +0300
commitbdf6880364c087dd857ea393e9f8c8dc6745244c (patch)
treedab9b39cf9e7ee488b51b1ec621bd30869b20c57 /test/x11comp.c
parentafbe21a2ef951817d1263e5863d7407b3cde0c80 (diff)
downloadxorg-lib-libxkbcommon-bdf6880364c087dd857ea393e9f8c8dc6745244c.tar.gz
test/x11comp: small simplifications
xkbcomp doesn't need the search-path argument, since we pass an absolute path. Keep the plain -I which clears the search path just to be sure. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'test/x11comp.c')
-rw-r--r--test/x11comp.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/x11comp.c b/test/x11comp.c
index bc87a72..71928a6 100644
--- a/test/x11comp.c
+++ b/test/x11comp.c
@@ -42,13 +42,13 @@ main(void)
int pipefds[2];
int ret, status;
char displayfd[128], display[128];
- char *search_path, *search_path_arg, *xkb_path;
+ char *xkb_path;
char *original, *dump;
char *envp[] = { NULL };
char *xvfb_argv[] = { "Xvfb", "-displayfd", displayfd, NULL };
pid_t xvfb_pid;
- char *xkbcomp_argv[] = { "xkbcomp", "-I", NULL /* search_path_arg */,
- NULL /* xkb_path */, display, NULL };
+ char *xkbcomp_argv[] = { "xkbcomp", "-I", NULL /* xkb_path */, display,
+ NULL };
pid_t xkbcomp_pid;
/*
@@ -108,15 +108,9 @@ main(void)
assert(device_id != -1);
xkb_path = test_get_path("keymaps/host.xkb");
- search_path = test_get_path("");
- assert(search_path);
- ret = asprintf(&search_path_arg, "-I%s", search_path);
assert(ret >= 0);
- xkbcomp_argv[2] = search_path_arg;
- xkbcomp_argv[3] = xkb_path;
+ xkbcomp_argv[2] = xkb_path;
ret = posix_spawnp(&xkbcomp_pid, "xkbcomp", NULL, NULL, xkbcomp_argv, envp);
- free(search_path_arg);
- free(search_path);
free(xkb_path);
if (ret != 0) {
ret = SKIP_TEST;
@@ -138,8 +132,7 @@ main(void)
dump = xkb_keymap_get_as_string(keymap, XKB_KEYMAP_USE_ORIGINAL_FORMAT);
assert(dump);
- ret = streq(original, dump);
- if (!ret) {
+ if (!streq(original, dump)) {
fprintf(stderr,
"round-trip test failed: dumped map differs from original\n");
fprintf(stderr, "length: dumped %lu, original %lu\n",