Convert more tests to installed tests
[platform/upstream/glib.git] / tests / unicode-encoding.c
index 9065b9e..09b3392 100644 (file)
@@ -1,3 +1,6 @@
+#undef G_DISABLE_ASSERT
+#undef G_LOG_DOMAIN
+
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -6,7 +9,7 @@
 
 static gint exit_status = 0;
 
-void
+static void
 croak (char *format, ...)
 {
   va_list va;
@@ -18,7 +21,7 @@ croak (char *format, ...)
   exit (1);
 }
 
-void
+static void
 fail (char *format, ...)
 {
   va_list va;
@@ -84,7 +87,7 @@ process (gint      line,
   const gchar *end;
   gboolean is_valid = g_utf8_validate (utf8, -1, &end);
   GError *error = NULL;
-  gint items_read, items_written;
+  glong items_read, items_written;
 
   switch (status)
     {
@@ -188,11 +191,11 @@ process (gint      line,
       gunichar2 *utf16_from_utf8;
       gunichar2 *utf16_from_ucs4;
       gunichar *ucs4_result;
-      gint bytes_written;
+      gsize bytes_written;
       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"
@@ -415,5 +418,5 @@ main (int argc, char **argv)
       line++;
     }
 
-  return 0;
+  return exit_status;
 }