After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752175 - tests: remove usage of g_assert()
tests: remove usage of g_assert()
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-09 14:32 UTC by Luis de Bethencourt
Modified: 2018-11-03 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch for gst-plugins-bad (7.88 KB, patch)
2015-07-09 14:32 UTC, Luis de Bethencourt
none Details | Review
same for gst-plugins-good (55.88 KB, patch)
2015-07-09 15:12 UTC, Luis de Bethencourt
none Details | Review

Description Luis de Bethencourt 2015-07-09 14:32:45 UTC
Created attachment 307147 [details] [review]
proposed patch for gst-plugins-bad

In relation to the discussion in https://bugzilla.gnome.org/show_bug.cgi?id=752123

Avoid usage of g_assert() in unit tests and use fail_unless() instead.

Would it be a good idea to create a new fail_if_reached() to replace the uses of g_assert_not_reached() in unit tests?
Comment 1 Tim-Philipp Müller 2015-07-09 14:41:57 UTC
But why? I mean, what's the point? This is unit tests... Consistency?

fail_*() admittedly has the advantage that you get a 'check point', so when it fails the 'test xyz failed after line 1234' will be more accurate.

There are also cases where we definitely do not want to make such a change, e.g. in inner loops of unit tests (e.g. I remember some unit tests did fail_*() on a per-pixel basis for video tests and the log file was huuuuuuuge as a result).
Comment 2 Luis de Bethencourt 2015-07-09 14:52:51 UTC
Precisely because if it fails the log will be more accurate.

I can keep the g_assert() in inner loops that could generate huge logs.
Comment 3 Luis de Bethencourt 2015-07-09 15:12:37 UTC
Created attachment 307151 [details] [review]
same for gst-plugins-good
Comment 4 GStreamer system administrator 2018-11-03 13:37:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/271.