From ab0d1b17247a5d03e0e333bd950dfddc624fc264 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 10 Jan 2013 11:18:46 -0300 Subject: [PATCH] tests: Add a macro for type checking --- tests/check/ges/test-utils.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/check/ges/test-utils.h b/tests/check/ges/test-utils.h index c104b98..b5c9120 100644 --- a/tests/check/ges/test-utils.h +++ b/tests/check/ges/test-utils.h @@ -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 */ -- 2.7.4