mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
tests: Allow g_mkdir_with_parents() to fail with EPERM
As well as with `EACCES`. This can happen if the filesystem as a whole is read-only, and has been spotted in the wild on macOS: ``` Bail out! GLib:ERROR:../glib/tests/fileutils.c:756:test_mkdir_with_parents: assertion failed (errno == EACCES): (1 == 13) stderr: ** GLib:ERROR:../glib/tests/fileutils.c:756:test_mkdir_with_parents: assertion failed (errno == EACCES): (1 == 13) ``` See: https://stackoverflow.com/q/68766316/2931197 See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1866500 Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
d497bdebc0
commit
9469922d5c
@ -753,7 +753,9 @@ test_mkdir_with_parents (void)
|
||||
g_assert_cmpint (g_mkdir_with_parents ("\\Windows\\b\\c", 0), ==, -1);
|
||||
#else
|
||||
g_assert_cmpint (g_mkdir_with_parents ("/usr/b/c", 0), ==, -1);
|
||||
g_assert_cmpint (errno, ==, EACCES);
|
||||
/* EPERM may be returned if the filesystem as a whole is read-only */
|
||||
if (errno != EPERM)
|
||||
g_assert_cmpint (errno, ==, EACCES);
|
||||
#endif
|
||||
|
||||
g_assert_cmpint (g_mkdir_with_parents (NULL, 0), ==, -1);
|
||||
|
Loading…
Reference in New Issue
Block a user