test_object_is_a(GObject *obj, GType is_a) { GType type = G_TYPE_INVALID; fail_unless(G_IS_OBJECT(obj), "'%p' is not an object.", obj); type = G_OBJECT_TYPE(obj); fail_unless(type != G_TYPE_INVALID, "'%p' appears to not have a GType.", obj); fail_unless(g_type_is_a(type, is_a), "'%s' is not a '%s'.", g_type_name(type), g_type_name(is_a));