From: Yu Watanabe Date: Sun, 22 Jun 2025 02:09:11 +0000 (+0900) Subject: test-glob-util: drop redundant test cases X-Git-Tag: v258-rc1~266^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b0c39458bab864f0279195c19513f15543cf1ee;p=thirdparty%2Fsystemd.git 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. --- 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;