GNOME Bugzilla – Bug 752175
tests: remove usage of g_assert()
Last modified: 2018-11-03 13:37:27 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?
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).
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.
Created attachment 307151 [details] [review] same for gst-plugins-good
-- 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.