+#undef G_DISABLE_ASSERT
+#undef G_LOG_DOMAIN
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
gint n_chars;
gchar *utf8_result;
-#ifdef G_OS_WIN32
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define TARGET "UTF-16LE"
#else
#define TARGET "UTF-16"
int
main (int argc, char **argv)
{
- gchar *srcdir = getenv ("srcdir");
gchar *testfile;
gchar *contents;
GError *error = NULL;
GArray *ucs4;
Status status = VALID; /* Quiet GCC */
- if (!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);
line++;
}
- return 0;
+ g_free (testfile);
+ g_array_free (ucs4, TRUE);
+ g_free (contents);
+ return exit_status;
}