+2006-07-31 Behdad Esfahbod <behdad@gnome.org>
+
+ * glib/gunidecomp.c (_g_utf8_normalize_wc): Update to reflect Unicode
+ PR #29 (#348694, Nikolai Weibull)
+
+ * tests/unicode-normalize.c (encode), (test_form): Make output more
+ useful, reporting the unexpected output of the test.
+
2006-07-24 Tor Lillqvist <tml@novell.com>
* tests/slice-test.c: Use g_get_current_time() insted of
+2006-07-31 Behdad Esfahbod <behdad@gnome.org>
+
+ * glib/gunidecomp.c (_g_utf8_normalize_wc): Update to reflect Unicode
+ PR #29 (#348694, Nikolai Weibull)
+
+ * tests/unicode-normalize.c (encode), (test_form): Make output more
+ useful, reporting the unexpected output of the test.
+
2006-07-24 Tor Lillqvist <tml@novell.com>
* tests/slice-test.c: Use g_get_current_time() insted of
"NFKC"
};
+static char *
+encode (const gchar *input)
+{
+ GString *result = g_string_new(NULL);
+
+ const gchar *p = input;
+ while (*p)
+ {
+ gunichar c = g_utf8_get_char (p);
+ g_string_append_printf (result, "%04X ", c);
+ p = g_utf8_next_char(p);
+ }
+
+ return g_string_free (result, FALSE);
+}
+
static void
test_form (int line,
GNormalizeMode mode,
char *result = g_utf8_normalize (c[i], -1, mode);
if (strcmp (result, c[expected]) != 0)
{
+ char *result_raw = encode(result);
fprintf (stderr, "\nFailure: %d/%d: %s\n", line, i + 1, raw[5]);
- fprintf (stderr, " g_utf8_normalize (%s, %s) != %s\n",
- raw[i], names[mode], raw[expected]);
+ fprintf (stderr, " g_utf8_normalize (%s, %s) != %s but %s\n",
+ raw[i], names[mode], raw[expected], result_raw);
+ g_free (result_raw);
success = FALSE;
}
char *result = g_utf8_normalize (c[i], -1, mode);
if (strcmp (result, c[expected]) != 0)
{
+ char *result_raw = encode(result);
fprintf (stderr, "\nFailure: %d/%d: %s\n", line, i, raw[5]);
- fprintf (stderr, " g_utf8_normalize (%s, %s) != %s\n",
- raw[i], names[mode], raw[expected]);
+ fprintf (stderr, " g_utf8_normalize (%s, %s) != %s but %s\n",
+ raw[i], names[mode], raw[expected], result_raw);
+ g_free (result_raw);
success = FALSE;
}