From bdf6880364c087dd857ea393e9f8c8dc6745244c Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 23 Aug 2015 22:22:11 +0300 Subject: 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 --- test/x11comp.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'test/x11comp.c') 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", -- cgit v1.2.1