mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
testsuite: Handle duplicate enum values
Our notify tests would fall over if there was a duplicate enum value (within the first 10 values). Make it handle that, by skipping the duplicate value.
This commit is contained in:
parent
082ba6d7c8
commit
58a5de6f5d
@ -89,8 +89,13 @@ check_property (GObject *instance, GParamSpec *pspec)
|
||||
|
||||
for (i = first; i < class->n_values; i++)
|
||||
{
|
||||
/* skip duplicates */
|
||||
if (i > 0 && class->values[i].value == class->values[i - 1].value)
|
||||
continue;
|
||||
|
||||
current_count = data.count + 1;
|
||||
g_object_set (instance, pspec->name, class->values[i].value, NULL);
|
||||
|
||||
assert_notifies (instance, pspec->name, data.count, current_count);
|
||||
|
||||
if (current_count == 10) /* just test a few */
|
||||
|
Loading…
Reference in New Issue
Block a user