]> Pileus Git - ~andy/gtk/commitdiff
tests: Check "without keycode" code path too
authorBastien Nocera <hadess@hadess.net>
Wed, 16 Nov 2011 16:13:01 +0000 (16:13 +0000)
committerBastien Nocera <hadess@hadess.net>
Wed, 16 Nov 2011 18:05:41 +0000 (18:05 +0000)
And see whether the output of gtk_accelerator_parse()
matches that of gtk_accelerator_parse_with_keycode()

gtk/tests/accel.c

index 072641368735263d26e5c1b0b974dd9d0dce2a13..5d36b38386a5a8f476b02ce3b9aa14c5a303da4f 100644 (file)
@@ -35,6 +35,18 @@ test_one_accel (const char *accel,
                                      &keycodes,
                                      &mods);
 
+  if (has_keysym)
+    {
+      guint accel_key_2;
+      GdkModifierType mods_2;
+
+      gtk_accelerator_parse (accel,
+                             &accel_key_2,
+                             &mods_2);
+      g_assert (accel_key == accel_key_2);
+      g_assert (mods == mods_2);
+    }
+
   if (has_keysym)
     g_assert (accel_key != 0);
   g_assert (keycodes);