check: Add _fail_unless() compatibility function around _ck_assert_failed()

We exported this in < 1.5 and it was automatically used by many macros
from the header. Keep it exported for now.
This commit is contained in:
Sebastian Dröge 2015-01-21 18:07:09 +01:00
parent a6373625f3
commit ee3db74ec4
2 changed files with 29 additions and 1 deletions

View file

@ -109,10 +109,14 @@ LIBGSTCHECK_EXPORTED_FUNCS = \
gst_test_clock_process_id_list \
gst_test_clock_id_list_get_latest_time
# For backwards compatibility with GStreamer < 1.5
LIBGSTCHECK_EXPORTED_COMPAT_FUNCS = \
_fail_unless
LIBGSTCHECK_EXPORTED_SYMBOLS = \
$(LIBGSTCHECK_EXPORTED_VARS) \
$(LIBGSTCHECK_EXPORTED_FUNCS)
$(LIBGSTCHECK_EXPORTED_FUNCS) \
$(LIBGSTCHECK_EXPORTED_COMPAT_FUNCS)
# Please do not even think about changing the alphabet below into A-Za-z.
# It is there for purpose. (Bug #602093)

View file

@ -1012,3 +1012,27 @@ gst_check_object_destroyed_on_unref (gpointer object_to_unref)
{
gst_check_objects_destroyed_on_unref (object_to_unref, NULL, NULL);
}
/* For ABI compatibility with GStreamer < 1.5 */
void
_fail_unless (int result, const char *file, int line, const char *expr, ...)
G_GNUC_PRINTF (4, 5);
void _fail_unless (int result, const char *file, int line,
const char *expr, ...)
{
gchar *msg;
va_list args;
if (result) {
_mark_point(file, line);
return;
}
va_start (args, expr);
msg = g_strdup_vprintf (expr, args);
va_end (args);
_ck_assert_failed (file, line, msg, NULL);
g_free (msg);
}