From: Tim-Philipp Müller Date: Thu, 19 Sep 2013 15:43:18 +0000 (+0100) Subject: check: testclock: don't put code with side-effects in g_assert() X-Git-Tag: 0.10.36~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc4ba028ff8c80110094017ff8159b6b9f5e7440;p=platform%2Fupstream%2Fgstreamer.git check: testclock: don't put code with side-effects in g_assert() Fixes unit test failures when -DG_DISABLE_ASSERT is used. https://bugzilla.gnome.org/show_bug.cgi?id=706551 --- diff --git a/libs/gst/check/gsttestclock.c b/libs/gst/check/gsttestclock.c index e103da8..22f26ae 100644 --- a/libs/gst/check/gsttestclock.c +++ b/libs/gst/check/gsttestclock.c @@ -785,8 +785,8 @@ gst_test_clock_wait_for_next_pending_id (GstTestClock * test_clock, while (priv->entry_contexts == NULL) g_cond_wait (&priv->entry_added_cond, GST_OBJECT_GET_LOCK (test_clock)); - g_assert (gst_test_clock_peek_next_pending_id_unlocked (test_clock, - pending_id)); + if (!gst_test_clock_peek_next_pending_id_unlocked (test_clock, pending_id)) + g_assert_not_reached (); GST_OBJECT_UNLOCK (test_clock); }