Test the new property and fix oversights found by the test

This commit is contained in:
Lukáš Tyrychtr 2024-03-07 13:43:39 +01:00
parent 38fd66dc04
commit 9bf23d80a1
3 changed files with 7 additions and 6 deletions

View File

@ -1667,7 +1667,7 @@ gtk_accessible_value_get_default_for_property (GtkAccessibleProperty property)
{
const GtkAccessibleCollect *cstate = &collect_props[property];
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
switch (cstate->value)
{
@ -1738,7 +1738,7 @@ gtk_accessible_value_collect_for_property (GtkAccessibleProperty property,
{
const GtkAccessibleCollect *cstate = &collect_props[property];
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
return gtk_accessible_value_collect_valist (cstate, error, args);
}
@ -1766,7 +1766,7 @@ gtk_accessible_value_collect_for_property_value (GtkAccessibleProperty propert
{
const GtkAccessibleCollect *cstate = &collect_props[property];
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
return gtk_accessible_value_collect_value (cstate, value, error);
}
@ -1779,7 +1779,7 @@ gtk_accessible_value_parse_for_property (GtkAccessibleProperty property,
{
const GtkAccessibleCollect *cstate = &collect_props[property];
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT, NULL);
g_return_val_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT, NULL);
return gtk_accessible_value_parse (cstate, str, len, error);
}
@ -1800,7 +1800,7 @@ gtk_accessible_property_init_value (GtkAccessibleProperty property,
{
const GtkAccessibleCollect *cstate = &collect_props[property];
g_return_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT);
g_return_if_fail (property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT);
gtk_accessible_attribute_init_value (cstate, value);
}

View File

@ -343,7 +343,7 @@ const char *
gtk_accessible_property_get_attribute_name (GtkAccessibleProperty property)
{
g_return_val_if_fail (property >= GTK_ACCESSIBLE_PROPERTY_AUTOCOMPLETE &&
property <= GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT,
property <= GTK_ACCESSIBLE_PROPERTY_HELP_TEXT,
"<none>");
return property_attrs[property];

View File

@ -649,6 +649,7 @@ main (int argc, char *argv[])
g_test_add_data_func ("/a11y/property/value-min", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_VALUE_MIN), test_number_property);
g_test_add_data_func ("/a11y/property/value-now", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_VALUE_NOW), test_number_property);
g_test_add_data_func ("/a11y/property/value-text", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT), test_string_property);
g_test_add_data_func ("/a11y/property/help-text", GUINT_TO_POINTER (GTK_ACCESSIBLE_PROPERTY_HELP_TEXT), test_string_property);
g_test_add_func ("/a11y/property/update-multiple", test_update_multiple_properties);