summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2013-04-03 11:02:13 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2013-04-03 12:26:24 +0200
commit49cf6904ed3c5cee461d1ddcbaff73f4a10e3426 (patch)
treee4026c914464c53b7c6bf1d9ea082439f3b9254e
parentc7dab2d3c6936443fb4aee43f54defa81b5dc592 (diff)
downloadtelepathy-glib-49cf6904ed3c5cee461d1ddcbaff73f4a10e3426.tar.gz
Fix test_utf8_make_valid()
Older GLib explicitly disallowed non-characters (as this test assumes) but newer GLib follows Unicode Corrigendum 9 and allows them. https://bugzilla.gnome.org/show_bug.cgi?id=694669
-rw-r--r--tests/util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/util.c b/tests/util.c
index bcf90c233..dad995ca6 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -76,7 +76,9 @@ test_utf8_make_valid (void)
/* last sequence of each length */
{ "\x7f", "\x7f" },
{ "\xdf\xbf", "\xdf\xbf" },
+#if !GLIB_CHECK_VERSION (2, 36, 0)
{ "\xef\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" },
+#endif
{ "\xf7\xbf\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" },
{ "\xfb\xbf\xbf\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" },
{ "\xfd\xbf\xbf\xbf\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" },
@@ -84,7 +86,9 @@ test_utf8_make_valid (void)
{ "\xed\x9f\xbf", "\xed\x9f\xbf" },
{ "\xee\x80\x80", "\xee\x80\x80" },
{ "\xef\xbf\xbd", "\xef\xbf\xbd" },
+#if !GLIB_CHECK_VERSION (2, 36, 0)
{ "\xf4\x8f\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" },
+#endif
{ "\xf4\x90\x80\x80", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" },
/* malformed sequences */
/* continuation bytes */
@@ -270,8 +274,10 @@ test_utf8_make_valid (void)
{ "\x20\xed\xae\x80\xed\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" },
{ "\x20\xed\xaf\xbf\xed\xb0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" },
{ "\x20\xed\xaf\xbf\xed\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" },
+#if !GLIB_CHECK_VERSION (2, 36, 0)
{ "\x20\xef\xbf\xbe\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" },
{ "\x20\xef\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" },
+#endif
{ NULL, NULL }
};