From 1b0c39458bab864f0279195c19513f15543cf1ee Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 22 Jun 2025 11:09:11 +0900 Subject: [PATCH] test-glob-util: drop redundant test cases The removed glob() with GLOB_ALTDIRFUNC is exactly the same as what safe_glob() does, which is tested in TEST(safe_glob) below. Let's drop the test cases. --- src/test/test-glob-util.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c index 7e1a264cb9d..754dc774471 100644 --- a/src/test/test-glob-util.c +++ b/src/test/test-glob-util.c @@ -51,37 +51,6 @@ TEST(glob_exists) { assert_se(r == 0); } -static void closedir_wrapper(void* v) { - (void) closedir(v); -} - -TEST(glob_no_dot) { - char template[] = "/tmp/test-glob-util.XXXXXXX"; - const char *fn; - - _cleanup_globfree_ glob_t g = { - .gl_closedir = closedir_wrapper, - .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot, - .gl_opendir = (void *(*)(const char *)) opendir, - .gl_lstat = lstat, - .gl_stat = stat, - }; - - int r; - - assert_se(mkdtemp(template)); - - fn = strjoina(template, "/*"); - r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g); - assert_se(r == GLOB_NOMATCH); - - fn = strjoina(template, "/.*"); - r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g); - assert_se(r == GLOB_NOMATCH); - - (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL); -} - TEST(safe_glob) { char template[] = "/tmp/test-glob-util.XXXXXXX"; const char *fn, *fn2, *fname; -- 2.47.3