[gtk+] tests: Add tests for keypad keys parsing
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests: Add tests for keypad keys parsing
- Date: Wed, 16 Nov 2011 18:51:07 +0000 (UTC)
commit ab27fa9bba319469a077828e13945a89144115c2
Author: Bastien Nocera <hadess hadess net>
Date: Wed Nov 16 18:49:54 2011 +0000
tests: Add tests for keypad keys parsing
See https://bugzilla.gnome.org/show_bug.cgi?id=606727
gtk/tests/accel.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/gtk/tests/accel.c b/gtk/tests/accel.c
index 5d36b38..d99ebb0 100644
--- a/gtk/tests/accel.c
+++ b/gtk/tests/accel.c
@@ -71,12 +71,41 @@ test_one_accel (const char *accel,
}
static void
-accel (void)
+accel1 (void)
{
test_one_accel ("0xb3", "0xb3", FALSE);
+}
+
+static void
+accel2 (void)
+{
test_one_accel ("<Primary><Alt>z", "Ctrl+Alt+Z", TRUE);
}
+static void
+accel3 (void)
+{
+ test_one_accel ("KP_7", "7", TRUE);
+}
+
+static void
+accel4 (void)
+{
+ test_one_accel ("<Primary>KP_7", "Ctrl+7", TRUE);
+}
+
+static void
+accel5 (void)
+{
+ test_one_accel ("<Shift>exclam", "Shift+!", TRUE);
+}
+
+static void
+keysyms (void)
+{
+ g_assert (gdk_keyval_from_name ("KP_7") == GDK_KEY_KP_7);
+}
+
int
main (int argc,
char *argv[])
@@ -84,6 +113,13 @@ main (int argc,
setlocale (LC_ALL, "en_GB.UTF-8");
gtk_test_init (&argc, &argv);
- g_test_add_func ("/accel", accel);
+
+ g_test_add_func ("/keysyms", keysyms);
+
+ g_test_add_func ("/accel1", accel1);
+ g_test_add_func ("/accel2", accel2);
+ g_test_add_func ("/accel3", accel3);
+ g_test_add_func ("/accel4", accel4);
+ g_test_add_func ("/accel5", accel5);
return g_test_run();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]