+ /* Test the G_(MIN|MAX|MAXU)(SHORT|INT|LONG) macros */
+
+ gus = G_MAXUSHORT;
+ gus++;
+ g_assert (gus == 0);
+
+ gui = G_MAXUINT;
+ gui++;
+ g_assert (gui == 0);
+
+ gul = G_MAXULONG;
+ gul++;
+ g_assert (gul == 0);
+
+ gsz = G_MAXSIZE;
+ gsz++;
+
+ g_assert (gsz == 0);
+
+ gs = G_MAXSHORT;
+ gs++;
+ g_assert (gs == G_MINSHORT);
+
+ gi = G_MAXINT;
+ gi++;
+ g_assert (gi == G_MININT);
+
+ gl = G_MAXLONG;
+ gl++;
+ g_assert (gl == G_MINLONG);
+
+ /* Test the G_G(U)?INT(16|32|64)_FORMAT macros */
+
+ gi16t1 = -0x3AFA;
+ gu16t1 = 0xFAFA;
+ gi32t1 = -0x3AFAFAFA;
+ gu32t1 = 0xFAFAFAFA;
+
+#define FORMAT "%" G_GINT16_FORMAT " %" G_GINT32_FORMAT \
+ " %" G_GUINT16_FORMAT " %" G_GUINT32_FORMAT "\n"
+ string = g_strdup_printf (FORMAT, gi16t1, gi32t1, gu16t1, gu32t1);
+ sscanf (string, FORMAT, &gi16t2, &gi32t2, &gu16t2, &gu32t2);
+ g_free (string);
+ g_assert (gi16t1 == gi16t2);
+ g_assert (gi32t1 == gi32t2);
+ g_assert (gu16t1 == gu16t2);
+ g_assert (gu32t1 == gu32t2);
+
+ gi64t1 = G_GINT64_CONSTANT (-0x3AFAFAFAFAFAFAFA);
+ gu64t1 = G_GINT64_CONSTANT (0xFAFAFAFAFAFAFAFA);
+
+#define FORMAT64 "%" G_GINT64_FORMAT " %" G_GUINT64_FORMAT "\n"
+ string = g_strdup_printf (FORMAT64, gi64t1, gu64t1);
+ sscanf (string, FORMAT64, &gi64t2, &gu64t2);
+ g_free (string);
+ g_assert (gi64t1 == gi64t2);
+ g_assert (gu64t1 == gu64t2);
+
+ gsst1 = -0x3AFAFAFA;
+ gst1 = 0xFAFAFAFA;
+
+#define FORMATSIZE "%" G_GSSIZE_FORMAT " %" G_GSIZE_FORMAT "\n"
+ string = g_strdup_printf (FORMATSIZE, gsst1, gst1);
+ sscanf (string, FORMATSIZE, &gsst2, &gst2);
+ g_free (string);
+ g_assert (gsst1 == gsst2);
+ g_assert (gst1 == gst2);
+