]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-glob-util: drop redundant test cases
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 22 Jun 2025 02:09:11 +0000 (11:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Jun 2025 14:11:44 +0000 (23:11 +0900)
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

index 7e1a264cb9da180a17a99f5bb785eb7f62fe5cf3..754dc774471544d39a0eb8717ea0dc4cf41bb87c 100644 (file)
@@ -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;