summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2019-09-02 12:21:11 +0100
committerPhilip Withnall <withnall@endlessm.com>2019-09-02 13:35:44 +0100
commit2118a8f73bdcfed1fc58c14ecc67744acf16d210 (patch)
treedb2fa7acaf685e53604d40c30b4f8f00d212bd49
parent4a089f9227ca948cec145e29499353829af8141b (diff)
downloadglib-2118a8f73bdcfed1fc58c14ecc67744acf16d210.tar.gz
tests: Fix skipping mkdir-with-parents-permission test
If the user has `CAP_DAC_OVERRIDE` or similar (for example, if running the tests as root), the `mkdir-with-parents-permission` test is skipped. The check for `CAP_DAC_OVERRIDE` was by creating a subdirectory of the test directory. That subdirectory, however, was never removed, which caused a ‘directory not empty’ error when trying to delete the test directory. Fix that by correctly deleting the subdirectory if skipping the test. Signed-off-by: Philip Withnall <withnall@endlessm.com>
-rw-r--r--glib/tests/fileutils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c
index a86ba478d..07a91a67f 100644
--- a/glib/tests/fileutils.c
+++ b/glib/tests/fileutils.c
@@ -548,6 +548,7 @@ test_mkdir_with_parents_permission (void)
if (g_mkdir (subdir2, 0700) == 0)
{
g_test_skip ("have CAP_DAC_OVERRIDE or equivalent, cannot test");
+ g_remove (subdir2);
}
else
{