diff --git a/gobject/tests/notify-init.c b/gobject/tests/notify-init.c index 99c628593..17500cbe9 100644 --- a/gobject/tests/notify-init.c +++ b/gobject/tests/notify-init.c @@ -124,8 +124,7 @@ test_object_set_property (GObject *gobject, TestObject *tobj = (TestObject *) gobject; g_assert_cmpint (prop_id, !=, 0); - g_assert_cmpint (prop_id, !=, N_PROPERTIES); - g_assert (pspec == properties[prop_id]); + g_assert_true (prop_id < N_PROPERTIES && pspec == properties[prop_id]); switch ((TestObjectProperty)prop_id) { @@ -159,8 +158,7 @@ test_object_get_property (GObject *gobject, TestObject *tobj = (TestObject *) gobject; g_assert_cmpint (prop_id, !=, 0); - g_assert_cmpint (prop_id, !=, N_PROPERTIES); - g_assert (pspec == properties[prop_id]); + g_assert_true (prop_id < N_PROPERTIES && pspec == properties[prop_id]); switch ((TestObjectProperty)prop_id) { diff --git a/gobject/tests/notify-init2.c b/gobject/tests/notify-init2.c index ab6677c1d..c3ebae002 100644 --- a/gobject/tests/notify-init2.c +++ b/gobject/tests/notify-init2.c @@ -132,8 +132,7 @@ test_object_set_property (GObject *gobject, TestObject *tobj = (TestObject *) gobject; g_assert_cmpint (prop_id, !=, 0); - g_assert_cmpint (prop_id, !=, N_PROPERTIES); - g_assert (pspec == properties[prop_id]); + g_assert_true (prop_id < N_PROPERTIES && pspec == properties[prop_id]); switch ((TestObjectProperty)prop_id) { @@ -167,8 +166,7 @@ test_object_get_property (GObject *gobject, TestObject *tobj = (TestObject *) gobject; g_assert_cmpint (prop_id, !=, 0); - g_assert_cmpint (prop_id, !=, N_PROPERTIES); - g_assert (pspec == properties[prop_id]); + g_assert_true (prop_id < N_PROPERTIES && pspec == properties[prop_id]); switch ((TestObjectProperty)prop_id) { diff --git a/gobject/tests/properties.c b/gobject/tests/properties.c index da467c2fe..e30a2705b 100644 --- a/gobject/tests/properties.c +++ b/gobject/tests/properties.c @@ -104,8 +104,7 @@ test_object_set_property (GObject *gobject, TestObject *tobj = (TestObject *) gobject; g_assert_cmpint (prop_id, !=, 0); - g_assert_cmpint (prop_id, !=, N_PROPERTIES); - g_assert (pspec == properties[prop_id]); + g_assert_true (prop_id < N_PROPERTIES && pspec == properties[prop_id]); switch (prop_id) { @@ -139,8 +138,7 @@ test_object_get_property (GObject *gobject, TestObject *tobj = (TestObject *) gobject; g_assert_cmpint (prop_id, !=, 0); - g_assert_cmpint (prop_id, !=, N_PROPERTIES); - g_assert (pspec == properties[prop_id]); + g_assert_true (prop_id < N_PROPERTIES && pspec == properties[prop_id]); switch (prop_id) {