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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
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",