summaryrefslogtreecommitdiff
path: root/tests/util.c
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:27:02 +0200
commitbda340636d7fd33902e8016113e957dac2561a70 (patch)
tree72fff50a38bc5393508590f1887b9d5f264a3bef /tests/util.c
parentaa640da529abdefc4cc459c3b61e035ad0ec6a71 (diff)
downloadtelepathy-glib-bda340636d7fd33902e8016113e957dac2561a70.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
Diffstat (limited to 'tests/util.c')
-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 }
};