[telepathy-glib-0.20] telepathy-glib: Fix test_utf8_make_valid()

Xavier Claessens xclaesse at kemper.freedesktop.org
Wed Apr 3 03:27:19 PDT 2013


Module: telepathy-glib
Branch: telepathy-glib-0.20
Commit: 49cf6904ed3c5cee461d1ddcbaff73f4a10e3426
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=49cf6904ed3c5cee461d1ddcbaff73f4a10e3426

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Wed Apr  3 11:02:13 2013 +0200

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

---

 tests/util.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tests/util.c b/tests/util.c
index bcf90c2..dad995c 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 }
   };



More information about the telepathy-commits mailing list