From: Matthias Clasen Date: Wed, 22 Mar 2023 00:06:37 +0000 (-0400) Subject: a11y: Add a test for gtk_accessible_role_to_name X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~518^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d04690d05cb712791b0af49c368c80f28d990ae2;p=gtk4.git a11y: Add a test for gtk_accessible_role_to_name This should prevent !5693 from happening again in the future. --- diff --git a/testsuite/gtk/a11y.c b/testsuite/gtk/a11y.c new file mode 100644 index 0000000000..56322546fe --- /dev/null +++ b/testsuite/gtk/a11y.c @@ -0,0 +1,29 @@ +#include +#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 (); +} diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index 73dd1369c3..d8a2e17e2c 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -128,6 +128,7 @@ internal_tests = [ { 'name': 'textbuffer' }, { 'name': 'texthistory' }, { 'name': 'fnmatch' }, + { 'name': 'a11y' }, ] is_debug = get_option('buildtype').startswith('debug')