tests: Test directories inside /tmp rather than arbitrary paths

This probably wasn’t causing any problems since it was a self-contained
read only access of a non-existent path. But it’s a bit tidier to
contain this all inside `/tmp`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2025-03-10 16:25:21 +00:00
parent 08489deb06
commit aae1743284
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -32,13 +32,15 @@ static void
test_dir_nonexisting (void)
{
GDir *dir;
GError *error;
GError *error = NULL;
char *path = NULL;
error = NULL;
dir = g_dir_open ("/pfrkstrf", 0, &error);
g_assert (dir == NULL);
path = g_build_filename (g_get_tmp_dir (), "does-not-exist", NULL);
dir = g_dir_open (path, 0, &error);
g_assert_null (dir);
g_assert_error (error, G_FILE_ERROR, G_FILE_ERROR_NOENT);
g_error_free (error);
g_free (path);
}
static void