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:
Matthias Clasen 2023-05-08 07:00:34 -04:00
parent 082ba6d7c8
commit 58a5de6f5d

View File

@ -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 */