mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-06 21:00:07 +02:00
tests: Use g_build_filename() rather than g_strdup_printf()
In the `g-file-info-filesystem-readonly` test. This doesn’t introduce any functional changes, but makes the code a little easier to read (because the parts of the path are now in hierarchical order) and makes it a bit clearer that we’re building a path rather than an arbitrary string. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
447fa26205
commit
4d2b873211
@ -128,9 +128,9 @@ test_filesystem_readonly (gconstpointer with_mount_monitor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
curdir = g_get_current_dir ();
|
curdir = g_get_current_dir ();
|
||||||
dir_to_mount = g_strdup_printf ("%s/dir_bindfs_to_mount", curdir);
|
dir_to_mount = g_build_filename (curdir, "dir_bindfs_to_mount", NULL);
|
||||||
file_in_mount = g_strdup_printf ("%s/example.txt", dir_to_mount);
|
file_in_mount = g_build_filename (dir_to_mount, "example.txt", NULL);
|
||||||
dir_mountpoint = g_strdup_printf ("%s/dir_bindfs_mountpoint", curdir);
|
dir_mountpoint = g_build_filename (curdir, "dir_bindfs_mountpoint", NULL);
|
||||||
|
|
||||||
g_mkdir (dir_to_mount, 0777);
|
g_mkdir (dir_to_mount, 0777);
|
||||||
g_mkdir (dir_mountpoint, 0777);
|
g_mkdir (dir_mountpoint, 0777);
|
||||||
@ -172,7 +172,7 @@ test_filesystem_readonly (gconstpointer with_mount_monitor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Let's check now, that the file is in indeed in a readonly filesystem */
|
/* Let's check now, that the file is in indeed in a readonly filesystem */
|
||||||
file_in_mountpoint = g_strdup_printf ("%s/example.txt", dir_mountpoint);
|
file_in_mountpoint = g_build_filename (dir_mountpoint, "example.txt", NULL);
|
||||||
mounted_file = g_file_new_for_path (file_in_mountpoint);
|
mounted_file = g_file_new_for_path (file_in_mountpoint);
|
||||||
|
|
||||||
if (with_mount_monitor)
|
if (with_mount_monitor)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user