Some final g_test_build_filename() porting

This should be the last users that need to be ported.

For some of the oldschool non-gtester-ified tests, we call g_test_init()
from main() because it is necessary in order to use
g_test_build_filename().
This commit is contained in:
Ryan Lortie
2013-05-29 23:49:30 -04:00
parent d7b3e558cf
commit e66abbe2ef
8 changed files with 20 additions and 38 deletions

View File

@@ -308,7 +308,6 @@ process (gint line,
int
main (int argc, char **argv)
{
const gchar *srcdir;
gchar *testfile;
gchar *contents;
GError *error = NULL;
@@ -321,13 +320,10 @@ main (int argc, char **argv)
GArray *ucs4;
Status status = VALID; /* Quiet GCC */
if (g_getenv ("G_TEST_DATA"))
srcdir = g_getenv ("G_TEST_DATA");
else
srcdir = SRCDIR;
testfile = g_strconcat (srcdir, G_DIR_SEPARATOR_S "utf8.txt", NULL);
g_test_init (&argc, &argv, NULL);
testfile = g_test_build_filename (G_TEST_DIST, "utf8.txt", NULL);
g_file_get_contents (testfile, &contents, NULL, &error);
if (error)
croak ("Cannot open utf8.txt: %s", error->message);