libs/gst/check/gstcheck.h: Fix detection of the check version we're compiling against...
authorPeter Kjellerstedt <pkj@axis.com>
Thu, 20 Dec 2007 09:20:27 +0000 (09:20 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 20 Dec 2007 09:20:27 +0000 (09:20 +0000)
Original commit message from CVS:
Patch by: Peter Kjellerstedt <pkj axis com>
* libs/gst/check/gstcheck.h:
Fix detection of the check version we're compiling against (would
otherwise break if check goes v0.10.0); correctly report the
name of the failed test again in case of failure, instead of
just 'tf' (fixes #504499).

ChangeLog
libs/gst/check/gstcheck.h

index 2a4f651..9d19294 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-12-20  Tim-Philipp Müller  <tim at centricular dot net>
+
+       Patch by: Peter Kjellerstedt <pkj axis com>
+
+       * libs/gst/check/gstcheck.h:
+         Fix detection of the check version we're compiling against (would
+         otherwise break if check goes v0.10.0); correctly report the
+         name of the failed test again in case of failure, instead of
+         just 'tf' (fixes #504499).
+
 2007-12-19  Wim Taymans  <wim.taymans@collabora.co.uk>
 
        * libs/gst/base/gstbasesrc.c: (gst_base_src_send_event),
index e7a2481..0de19f6 100644 (file)
@@ -94,7 +94,9 @@ gst_check_message_error (msg, GST_MESSAGE_ERROR,              \
  *
  * wrapper for checks END_TEST
  */
-#if CHECK_MAJOR_VERSION >= 0 && CHECK_MINOR_VERSION >= 9 && CHECK_MICRO_VERSION >= 4
+#if CHECK_MAJOR_VERSION > 0 || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION > 9) || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION > 3)
 #define GST_START_TEST(__testname) \
 static void __testname (int __i__)\
 {\
@@ -401,16 +403,28 @@ int main (int argc, char **argv)                          \
 
 gboolean _gst_check_run_test_func (const gchar * func_name);
 
+#if CHECK_MAJOR_VERSION > 0 || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION > 9) || \
+    (CHECK_MAJOR_VERSION == 0 && CHECK_MINOR_VERSION == 9 && CHECK_MICRO_VERSION > 3)
 static inline void
-__gst_tcase_add_test (TCase * tc, TFun tf, const gchar * func_name)
+__gst_tcase_add_test (TCase * tc, TFun tf, const char * fname, int signal,
+    int start, int end)
 {
-  if (_gst_check_run_test_func (func_name)) {
-    tcase_add_test (tc, tf);
+  if (_gst_check_run_test_func (fname)) {
+    _tcase_add_test (tc, tf, fname, signal, start, end);
   }
 }
+#else
+static inline void
+__gst_tcase_add_test (TCase * tc, TFun tf, const char * fname, int signal)
+{
+  if (_gst_check_run_test_func (fname)) {
+    _tcase_add_test (tc, tf, fname, signal);
+  }
+}
+#endif
 
-#undef tcase_add_test
-#define tcase_add_test(tc,tf) __gst_tcase_add_test(tc,tf,G_STRINGIFY(tf))
+#define _tcase_add_test __gst_tcase_add_test
 
 G_END_DECLS