Merge branch 'matthiasc/for-main' into 'main'

Add some more keysyms tests

See merge request GNOME/gtk!5745
This commit is contained in:
Matthias Clasen
2023-03-29 12:05:58 +00:00
2 changed files with 11 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ test_unset_display (void)
g_test_trap_subprocess ("/display/unset-display/subprocess/2", 0, 0);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*cannot open display*");
g_test_trap_assert_stderr ("*Failed to open display*");
}
static void
@@ -62,7 +62,7 @@ test_bad_display (void)
g_test_trap_subprocess ("/display/bad-display/subprocess/2", 0, 0);
g_test_trap_assert_failed ();
g_test_trap_assert_stderr ("*cannot open display*");
g_test_trap_assert_stderr ("*Failed to open display*");
}
int

View File

@@ -113,6 +113,10 @@ test_key_unicode (void)
{ GDK_KEY_A, 'A' },
{ GDK_KEY_EuroSign, 0x20ac },
{ UNICODE_KEYVAL (0x1f60b), 0x1f60b },
},
oneway_tests[] = {
{ GDK_KEY_KP_0, '0' },
{ GDK_KEY_KP_Divide, '/' },
};
guint i;
@@ -121,6 +125,11 @@ test_key_unicode (void)
g_assert_cmpuint (gdk_keyval_to_unicode (tests[i].key), ==, tests[i].ch);
g_assert_cmpuint (gdk_unicode_to_keyval (tests[i].ch), ==, tests[i].key);
}
for (i = 0; i < G_N_ELEMENTS (oneway_tests); i++)
{
g_assert_cmpuint (gdk_keyval_to_unicode (tests[i].key), ==, tests[i].ch);
}
}
int