tests: Add a macro for type checking
authorThibault Saunier <thibault.saunier@collabora.com>
Thu, 10 Jan 2013 14:18:46 +0000 (11:18 -0300)
committerThibault Saunier <thibault.saunier@collabora.com>
Thu, 10 Jan 2013 14:18:46 +0000 (11:18 -0300)
tests/check/ges/test-utils.h

index c104b98..b5c9120 100644 (file)
@@ -66,4 +66,11 @@ gchar * ges_test_file_uri (const gchar *filename);
     g_error_free (error);                                              \
   } G_STMT_END;
 
+#define assert_is_type(object, type)                    \
+G_STMT_START {                                          \
+ fail_unless (g_type_is_a(G_OBJECT_TYPE(object), type), \
+     "%s is not a %s", G_OBJECT_TYPE_NAME(object),      \
+     g_type_name (type));                               \
+} G_STMT_END;
+
 #endif /* _GES_TEST_UTILS */