[glib] Add a test for g_unichar_validate
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add a test for g_unichar_validate
- Date: Mon, 21 Jun 2010 04:02:25 +0000 (UTC)
commit 60a5b197991aae58de4a85c9020a49edc5003457
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jun 21 00:00:51 2010 -0400
Add a test for g_unichar_validate
glib/tests/utf8-misc.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/utf8-misc.c b/glib/tests/utf8-misc.c
index d8f6c5a..0885bb3 100644
--- a/glib/tests/utf8-misc.c
+++ b/glib/tests/utf8-misc.c
@@ -85,6 +85,17 @@ test_utf8_strrchr (void)
g_assert (g_utf8_strrchr (string, -1, 'x') == NULL);
}
+static void
+test_unichar_validate (void)
+{
+ g_assert (g_unichar_validate ('j'));
+ g_assert (g_unichar_validate (8356));
+ g_assert (g_unichar_validate (8356));
+ g_assert (!g_unichar_validate (0xfdd1));
+ g_assert (g_unichar_validate (917760));
+ g_assert (!g_unichar_validate (0x110000));
+}
+
int
main (int argc,
char *argv[])
@@ -94,6 +105,7 @@ main (int argc,
g_test_add_func ("/utf8/strlen", test_utf8_strlen);
g_test_add_func ("/utf8/strncpy", test_utf8_strncpy);
g_test_add_func ("/utf8/strrchr", test_utf8_strrchr);
+ g_test_add_func ("/unicode/validate", test_unichar_validate);
return g_test_run();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]