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

@@ -12,7 +12,6 @@ int main (int argc, char **argv)
FILE *infile;
char buffer[1024];
char **strings;
const char *srcdir;
char *filename;
const char *locale;
const char *test;
@@ -21,12 +20,9 @@ int main (int argc, char **argv)
char *current_locale = setlocale (LC_CTYPE, NULL);
gint result = 0;
if (g_getenv ("G_TEST_DATA"))
srcdir = g_getenv ("G_TEST_DATA");
else
srcdir = SRCDIR;
g_test_init (&argc, &argv, NULL);
filename = g_strconcat (srcdir, G_DIR_SEPARATOR_S, "casemap.txt", NULL);
filename = g_test_build_filename (G_TEST_DIST, "casemap.txt", NULL);
infile = fopen (filename, "r");
if (!infile)
@@ -96,7 +92,7 @@ int main (int argc, char **argv)
fclose (infile);
g_free (filename);
filename = g_strconcat (srcdir, G_DIR_SEPARATOR_S, "casefold.txt", NULL);
filename = g_test_build_filename (G_TEST_DIST, "casefold.txt", NULL);
infile = fopen (filename, "r");
if (!infile)