Commit graph

89 commits

Author SHA1 Message Date
Tim-Philipp Müller 58558bb90c check: suppress g-ir-scanner warnings
Make g-ir-scanner skip all those check macros that are
not useful for or usable from bindings.

gstcheck.h:209: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_message_error'
gstcheck.h:212: Warning: GstCheck: Unknown namespace for symbol 'assert_message_error'
gstcheck.h:251: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_int'
gstcheck.h:267: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_int'
gstcheck.h:280: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_int_hex'
gstcheck.h:299: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_int_hex'
gstcheck.h:310: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_int64'
gstcheck.h:327: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_int64'
gstcheck.h:340: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_int64_hex'
gstcheck.h:358: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_int64_hex'
gstcheck.h:369: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_uint64'
gstcheck.h:386: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_uint64'
gstcheck.h:399: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_uint64_hex'
gstcheck.h:417: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_uint64_hex'
gstcheck.h:428: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_string'
gstcheck.h:444: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_string'
gstcheck.h:455: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_float'
gstcheck.h:474: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_float'
gstcheck.h:487: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_pointer'
gstcheck.h:506: Warning: GstCheck: Unknown namespace for symbol 'assert_equals_pointer'
gstcheck.h:517: Warning: GstCheck: Unknown namespace for symbol 'fail_unless_equals_clocktime'
gstcheck.h:534: Warning: GstCheck: Unknown namespace for symbol 'MAIN_START_THREADS'
gstcheck.h:547: Warning: GstCheck: Unknown namespace for symbol 'MAIN_START_THREAD_FUNCTIONS'
gstcheck.h:555: Warning: GstCheck: Unknown namespace for symbol 'MAIN_START_THREAD_FUNCTION'
gstcheck.h:626: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_CRITICAL'
gstcheck.h:628: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_CRITICAL'
gstcheck.h:640: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_WARNING'
gstcheck.h:652: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_OBJECT_REFCOUNT'
gstcheck.h:661: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_OBJECT_REFCOUNT_BETWEEN'
gstcheck.h:676: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_CAPS_REFCOUNT'
gstcheck.h:679: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_BUFFER_REFCOUNT'
gstcheck.h:682: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_MINI_OBJECT_REFCOUNT'
gstcheck.h:690: Warning: GstCheck: Unknown namespace for symbol 'ASSERT_SET_STATE'
gstcheck.h:729: Warning: GstCheck: Unknown namespace for symbol 'tcase_skip_broken_test'
gstcheck.h:740: Warning: GstCheck: Unknown namespace for symbol 'tcase_skip_broken_loop_test'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/579>
2020-07-26 15:34:54 +01:00
Seungha Yang 4b6245597c check: Use g_thread_yield instead of g_usleep(1)
Since the commit
01c02ac08b,
g_usleep(1) will be translated to Sleep(1) on Windows which means
sleep in 1 millisecond. But GLib provides g_thread_yield() API
which is exactly what we required here for thread context switching.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/559>
2020-07-08 05:16:28 +09:00
Nirbheek Chauhan 7cfdb23387 gstcheck: Document strcmp used in string cmp macros
strcmp() does not allow the arguments to be NULL, but g_strcmp0()
does, so document that we use g_strcmp0() so that people don't need to
worry about that.
2019-07-01 11:51:46 +00:00
Thibault Saunier 5b2da0835e doc: Fix and add some missing docstrings 2019-05-13 11:33:49 -04:00
Havard Graff 1335110409 tests: fix tests when compiling with glib_checks=disabled
We won't be able to do ASSERT_CRITICAL, but the main body of the tests
are still valid, and given we ship GStreamer with this configuration, it
is important to be able to run some tests against it.
2018-11-10 15:37:36 +00:00
Thibault Saunier 8f76257ac0 check: Add a fail_unless_equals_clocktime macro for convenience 2018-07-08 20:56:16 -04:00
luz.paz 4a402c1c7d Fix typos in comments and docs
Found via `codespell`

https://bugzilla.gnome.org/show_bug.cgi?id=795610
2018-05-01 11:18:03 +01:00
Edward Hervey 09791e859c libs: Documentation fixes
* Symbols not properly exposed or wrongly named
2018-04-02 12:41:48 +02:00
Tim-Philipp Müller 357e7c7b02 check: GST_EXPORT -> GST_CHECK_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 00:57:36 +00:00
Tim-Philipp Müller f5f21e5e8b libs: check: sprinkle some GST_EXPORT
Have to modify libcheck header a bit to avoid warnings
about duplicate 'extern extern'.

Also needs some additions to the libcheck meson.build file
to define CK_EXP_DLL when building the static libcheck.
2017-08-10 12:04:53 +01:00
Stian Selnes 0c36e5766d check: Add API to filter g_warning/g_critical etc
New API functions to filter log messages before they are processed by
GstCheck. This can be used to discard specific messages that are
accepted by the test or to add callbacks that test specific messages.

Default bevavior when no callback is given to a filter is to discard the
message, because it does not makes sense to have a filter with no
callback which does not discard; that would be a noop.

Discarded messages will in addition to bypass the GstCheck handling also
return to GLib that the message is not fatal if it occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=773091
2017-01-24 00:11:59 +00:00
Thibault Saunier f7255f318f check: Allow listing unit tests names
Adding options while running gst_check_init

https://bugzilla.gnome.org/show_bug.cgi?id=775540
2016-12-16 13:46:39 -03:00
Stian Selnes 9d56c0e397 check: fix unused parameter compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=761919
2016-02-12 16:38:43 +00:00
Stian Selnes 2450af1034 check: Add tcase_skip_broken_loop_test
https://bugzilla.gnome.org/show_bug.cgi?id=761917
2016-02-12 11:14:33 +00:00
Tim-Philipp Müller ac8d5cac4e check: optionally check env var for us to make sure test env is set up
If GST_CHECK_TEST_ENVIRONMENT_BEACON is defined, check if the
environment variable it is defined to is set up at the start
of each test.

https://bugzilla.gnome.org//show_bug.cgi?id=747624
2015-04-23 15:54:08 +01:00
Mathieu Duponchelle 0ee2183aa5 check: cast element in ASSERT_SET_STATE.
https://bugzilla.gnome.org/show_bug.cgi?id=744777
2015-02-19 12:18:50 +01:00
Sebastian Rasmussen 85c8b5d2c4 check: Apply GStreamer-specific patches
Reintroduced patches:

 * Make sure that fail_if(1) actually fails
   from commit 9f99d056a2

New patches due to updated libcheck (based on 0.9.14):

 * Checks in m4/check-checks.m4 to cater for new dependencies
 * Conditional compile-time compat POSIX fallbacks for libcheck
 * Avoid relative paths for libcheck header files
 * Make timer_create() usage depend on posix timers, not librt
 * Rely on default AX_PTHREAD behavior to allow HAVE_PTHREAD to be used
   when checking for types and functions (like clock_gettime())
 * Avoid double declaration of clock_gettime() when availabe outside of
   librt by making compat clock_gettime() declaration conditional
 * check 0.9.9 renamed _fail_unless() and 0.9.12 later renamed it again
   to _ck_assert_failed(), so ASSERT_{CRITICAL,WARNING}() now calls this
   function
 * Remove libcheck fallback infrastructure for malloc(), realloc(),
   gettimeofday() and snprintf() since either they appear to be
   available or they introduce even more dependencies.

The result is an embedded check in gstreamer that has been tested by
running check tests in core, -base, -good, -bad, -ugly and rtsp-server
on Linux, OSX and Windows.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826
2014-12-06 17:48:25 +01:00
Sebastian Dröge 154eefecc9 Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.

Also normalize booleans in a few places.
2014-12-01 09:51:37 +01:00
Thibault Saunier 87a79673b0 check: Add a function to check destruction of objects
Add a method letting people to ensure that unreffing one object
leads to its destruction, and possibly the destruction of more object
(think destruction of a GstBin etc...).

https://bugzilla.gnome.org/show_bug.cgi?id=736477
2014-09-12 17:18:21 +02:00
Tim-Philipp Müller ba31faf261 libs: gstcheck: check that mutex is locked before g_cond_wait*() is called
Sanity check to catch problems in unit test.
2014-07-06 12:13:04 +01:00
Tim-Philipp Müller b2bbd1edfa libs: gstcheck: init and clear global mutex and cond variables 2014-07-06 12:12:20 +01:00
Sebastian Dröge 917a033d04 check: Add new API to set up pads from non-static pad templates 2014-04-15 12:58:59 +02:00
Stefan Sauer 6fc23cd016 check: also use the glob on GST_CHECKS when forcing to run broken tests
GST_CHECKS can be simply "test*" to run run all tests (including those that are
marked broken). Update the sparse comments a bit to tell how this works.
2014-02-19 11:04:17 +01:00
Olivier Crête 75aa2bd86f check: Change stream_id parameter name to match GtkDoc 2013-07-01 20:07:03 -04:00
Jonas Holmberg 0ea8748c6b check: Added gst_check_setup_events_with_stream_id()
Added a new function gst_check_setup_events_with_stream_id(), since
gst_check_setup_events() does not work with multiple pads.

https://bugzilla.gnome.org/show_bug.cgi?id=703377
2013-07-01 15:54:11 +02:00
Nicolas Dufresne a1866e64c5 check: Add helper that sends initial events
https://bugzilla.gnome.org/show_bug.cgi?id=700033
2013-05-10 09:23:28 +02:00
Tim-Philipp Müller e2b09b1ab9 check: run skipped tests if explicitly requested via GST_CHECKS
If a test that's disabled with tcase_skip_broken_test() is listed
in the GST_CHECKS environment variable, run it anyway.
2013-04-18 00:19:23 +01:00
Tim-Philipp Müller 22b7c0bf58 check: add some more fail_unless_*() macros for convenience
API: fail_unless_equals_int_hex
API: assert_equals_int_hex
API: fail_unless_equals_int64_hex
API: assert_equals_int64_hex
API: fail_unless_equals_uint64_hex
API: assert_equals_uint64_hex
API: fail_unless_equals_pointer
API: assert_equals_pointer
2013-02-19 17:40:20 +00:00
Sebastian Dröge e58dabc750 libs: Use foo/foo.h as single-include header consistently everywhere
https://bugzilla.gnome.org/show_bug.cgi?id=688785
2012-12-12 16:44:14 +00:00
Evan Nemerson 1afb1f12ef libs: Add missing single include headers and use them in GIRs 2012-11-21 11:00:40 +01:00
Tim-Philipp Müller 666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Tim-Philipp Müller 7eb64ad7a9 check: fix FIXME printing for tcase_skip_broken_test() 2012-09-23 19:56:43 +01:00
Mark Nauwelaerts 9454c8c626 check: remove glib deprecation compatibility trickery 2012-09-12 13:02:06 +02:00
Mark Nauwelaerts bb4860d961 check: port to the new GLib thread API 2012-09-12 13:01:18 +02:00
Tim-Philipp Müller c0f1ff5f79 check: add tcase_skip_broken_test() define
Skips broken tests but logs an ERROR-level message to
draw attention to that fact.
2012-08-05 17:16:27 +01:00
Edward Hervey d3ffa82639 Remove 0.10-related documentation and "Since" markers 2012-07-10 12:03:27 +02:00
Wim Taymans a1c5b00e72 memory: make GstMemory a miniobject 2012-06-14 16:34:28 +02:00
Olivier Crête 8f8335a7f4 check: Update gst_check_element_push_buffer to 0.11 style caps
Pass the desired caps explicitely
2012-01-28 16:42:38 +00:00
Wim Taymans ad659abe8e check: add macro to check for memory refcount 2012-01-05 13:09:29 +01:00
Tim-Philipp Müller eaa2d81474 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst/gstindexfactory.c
	libs/gst/base/gstbasetransform.c
	plugins/elements/gstfakesink.c
	plugins/elements/gstfakesrc.c
	plugins/elements/gstidentity.c
	plugins/elements/gstinputselector.c
	plugins/elements/gstoutputselector.c

Note: did not merge any of the basetransform changes from 0.10.
2011-12-08 00:39:10 +00:00
Tim-Philipp Müller 8811cbc5aa check: allow non-joinable threads in private g_thread_create() copy
Looks like some tests use non-joinable threads after all.
2011-12-04 21:20:07 +00:00
Tim-Philipp Müller a1daf846f3 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst/gstobject.h
	libs/gst/check/gstcheck.h
	libs/gst/controller/gstcontroller.c
	plugins/elements/gstidentity.c
	tools/gst-xmlinspect.c
2011-12-04 15:38:09 +00:00
Tim-Philipp Müller 5889260d5a Work around deprecated thread API in glib master
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We can't change most of
these in 0.10 because they're part of our API and ABI.
2011-12-04 13:35:38 +00:00
Tim-Philipp Müller ca179625f8 g_thread_create() is deprecated in GLib master, use g_thread_try_new() instead 2011-12-03 13:58:51 +00:00
René Stadler f6e992cb06 check: drop caps argument from gst_check_setup_{src,sink}_pad
Calling set_caps at that point is not useful in 0.10 (FIXME comment!), and in
0.11 it is totally pointless: the caps event doesn't stick to a flushing pad.
2011-11-24 21:43:31 +01:00
Wim Taymans 612b1fbb14 pad: add parent to other functions
Add parent to chain, chain_list, getrange and event functions.
2011-11-17 12:40:45 +01:00
Wim Taymans 841ad590b9 .h: fix header files
Ensure correct indentation and retab
Make sure all structure have padding
2011-11-11 17:30:03 +01:00
Edward Hervey acd905d78a gstcheck: Make ASSERT_MINI_OBJECT_REFCOUNT more useful
knowing which miniobject failed helps us locate it in debug logs
2011-10-17 09:51:15 +02:00
Wim Taymans b0fad063b5 Merge branch 'master' into 0.11 2011-05-24 17:43:36 +02:00
Debarshi Ray f9a4dcd074 check: add fail_unless_equals_int64
https://bugzilla.gnome.org/show_bug.cgi?id=650973
2011-05-24 16:21:20 +02:00