From b0ba7ff0317312039154c34b6ddd3211ccb59257 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Thu, 20 Dec 2007 09:20:27 +0000 Subject: [PATCH] libs/gst/check/gstcheck.h: Fix detection of the check version we're compiling against (would otherwise break if check... Original commit message from CVS: Patch by: Peter Kjellerstedt * 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 | 10 ++++++++++ libs/gst/check/gstcheck.h | 26 ++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a4f651..9d19294 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-12-20 Tim-Philipp Müller + + Patch by: Peter Kjellerstedt + + * 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 * libs/gst/base/gstbasesrc.c: (gst_base_src_send_event), diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h index e7a2481..0de19f6 100644 --- a/libs/gst/check/gstcheck.h +++ b/libs/gst/check/gstcheck.h @@ -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 -- 2.7.4