Convert some gio tests to installed tests

This commit is contained in:
Matthias Clasen
2013-05-20 06:38:41 -04:00
parent f66016261a
commit 5e1f9173c3
16 changed files with 314 additions and 148 deletions

View File

@@ -27,6 +27,8 @@
#include <stdlib.h>
#include <string.h>
static const gchar *datapath;
static void
test_g_icon_to_string (void)
{
@@ -465,8 +467,11 @@ test_file_icon (void)
GError *error;
GInputStream *stream;
gchar *str;
gchar *path;
file = g_file_new_for_path (SRCDIR "/g-icon.c");
path = g_strconcat (datapath, "/g-icon.c", NULL);
file = g_file_new_for_path (path);
icon = g_file_icon_new (file);
g_object_unref (file);
@@ -484,12 +489,19 @@ test_file_icon (void)
g_object_unref (icon);
g_object_unref (icon2);
g_free (path);
}
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_add_func ("/icons/to-string", test_g_icon_to_string);