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

a11y: Add a test for gtk_accessible_role_to_name

See merge request GNOME/gtk!5694
This commit is contained in:
Matthias Clasen 2023-03-22 00:24:52 +00:00
commit c237957ef0
2 changed files with 30 additions and 0 deletions

29
testsuite/gtk/a11y.c Normal file
View File

@ -0,0 +1,29 @@
#include <gtk/gtk.h>
#include "gtk/gtkaccessibleprivate.h"
static void
test_role_to_name (void)
{
GEnumClass *class;
class = g_type_class_ref (GTK_TYPE_ACCESSIBLE_ROLE);
for (unsigned int i = 0; i < class->n_values; i++)
{
GtkAccessibleRole role = class->values[i].value;
g_assert_nonnull (gtk_accessible_role_to_name (role, "gtk40"));
}
g_type_class_unref (class);
}
int
main (int argc, char *argv[])
{
(g_test_init) (&argc, &argv, NULL);
g_test_add_func ("/a11y/role-to-name", test_role_to_name);
return g_test_run ();
}

View File

@ -128,6 +128,7 @@ internal_tests = [
{ 'name': 'textbuffer' }, { 'name': 'textbuffer' },
{ 'name': 'texthistory' }, { 'name': 'texthistory' },
{ 'name': 'fnmatch' }, { 'name': 'fnmatch' },
{ 'name': 'a11y' },
] ]
is_debug = get_option('buildtype').startswith('debug') is_debug = get_option('buildtype').startswith('debug')