tests: use new g_test_build_filename() API

Port most of the tests to the new g_test_build_filename() API.

https://bugzilla.gnome.org/show_bug.cgi?id=549783
This commit is contained in:
Ryan Lortie
2013-05-28 12:48:37 -04:00
parent 0c4806733c
commit 58c6ca32aa
19 changed files with 62 additions and 200 deletions

View File

@@ -7,8 +7,6 @@
#include <sys/stat.h>
#endif
static const gchar *datapath;
static void
test_basic (void)
{
@@ -85,8 +83,11 @@ test_type (void)
GFile *file;
GFileType type;
GError *error = NULL;
gchar *datapath;
datapath = g_test_build_filename (G_TEST_DISTED, ".", NULL);
datapath_f = g_file_new_for_path (datapath);
g_free (datapath);
file = g_file_get_child (datapath_f, "g-icon.c");
type = g_file_query_file_type (file, 0, NULL);
@@ -793,11 +794,6 @@ test_copy_preserve_mode (void)
int
main (int argc, char *argv[])
{
if (g_getenv ("G_TEST_DATA"))
datapath = g_getenv ("G_TEST_DATA");
else
datapath = SRCDIR;
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");