mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-19 08:27:52 +02:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user