Commit graph

882 commits

Author SHA1 Message Date
Tim-Philipp Müller 4a757e651a tests: bus: add unit test for async message delivery 2015-02-17 09:52:14 +00:00
Jan Schmidt bbae71133d tests: Fix clock regression test
Fix up the values the test is checking for now that
the clock regression returns parameters starting from
the end of the regression range.
2015-02-07 05:16:23 +11:00
Sebastian Dröge 40a0275298 uri: Fix indention 2015-01-22 23:10:06 +02:00
David Waring d20fa132c1 uri: Fix new URI parsing tests based on GNet's
https://bugzilla.gnome.org/show_bug.cgi?id=743195
2015-01-22 22:08:12 +01:00
Sebastian Dröge 0637703fe7 uri: Add parsing unit test based on GNet's
Plus some new URIs to parse.

https://git.gnome.org/browse/archive/gnet/plain/tests/check/gnet/gneturi.c

https://bugzilla.gnome.org/show_bug.cgi?id=743195
2015-01-22 22:07:46 +01:00
Jan Schmidt 81d613694c clock: Improve slaving regression.
Add domain checks for the input values, and a variable precision
calculation that loops if necessary to ensure we never overflow
accumulators and then silently produce garbage results.

Make the (non-public) linear regression function available for
unit testing by putting it in a separate source file the test
can include. Add a unit test that the new regression function
produces sensible results for several inputs taken from real-world
captures.
2015-01-21 22:27:18 +11:00
Sebastian Dröge 1f6d5d3ff5 structure/caps: Add gst_{structure,caps}_filter_and_map_in_place()
https://bugzilla.gnome.org/show_bug.cgi?id=739765
2014-12-16 18:22:46 +01:00
Sebastian Dröge 6925fa1b7c structure: Add simple unit test for foreach() and map_in_place() 2014-12-16 18:22:46 +01:00
Sebastian Dröge bc11a1b79d caps: Add gst_caps_foreach() and gst_caps_map_in_place()
https://bugzilla.gnome.org/show_bug.cgi?id=739765
2014-12-16 18:22:46 +01:00
Nicolas Dufresne a8d6653037 bufferpool: Don't check size in config validation
Pools are allowed to change the size in order to adapt padding. So
don't check the size. Normally pool will change the size without
failing set_config(), but it they endup changing the size before
the validate method may fail on a false positive.

https://bugzilla.gnome.org/show_bug.cgi?id=741420
2014-12-16 10:20:37 -05:00
Wim Taymans 5cf630697c structure: don't overread input when searching for "
When searching for the string terminator don't read past the ending
0-byte when escaping characters.
Add unit test for various escaping cases.
2014-11-20 13:37:08 +01:00
Haakon Sporsheim 6c079367f1 task: Fix pause/stop race condition
If a task thread is calling pause on it self and the
controlling/"main" thread stops the task, it could end in a race
where gst_task_func loops and then checks for paused after the
controlling thread just changed the task state to stopped.
Hence the task would actually call func again even though it was
both paused and stopped.

https://bugzilla.gnome.org/show_bug.cgi?id=740001
2014-11-12 12:00:48 +01:00
Sebastian Dröge d600fc48f8 gstobject: Don't check booleans for equality in the unit test
Every value other than 0/FALSE is TRUE, == TRUE will only check for 1.
2014-11-10 10:03:57 +01:00
Jan Alexander Steffens (heftig) 5a930aa642 gstobject: Add gst_object_has_parent()
Adds gst_object_has_parent, which works like gst_object_has_ancestor
but does not ascend further.

API: gst_object_has_parent()
2014-11-10 10:03:57 +01:00
Linus Svensson bf8e36a768 tests: Add a test for removing a bus watch
https://bugzilla.gnome.org/show_bug.cgi?id=735195
2014-10-14 10:31:27 +02:00
Linus Svensson c8b512d2f0 bus: Add a function to remove a bus watch
If a bus watch is added to the non default main context it's not
possible to remove it using g_source_remove().

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=735195
2014-10-14 10:31:18 +02:00
David Waring 54c5f1855c GstUri: Add GstUri miniobject to handle URIs in an RFC 3986 compliant fashion
https://bugzilla.gnome.org/show_bug.cgi?id=725221
2014-09-29 12:19:05 +03:00
Wim Taymans 7e33f52961 tests: add flush-stop on inactive pad test
Check that pushing flush-stop on an inactive pad does not clear the
flushing flag.
2014-09-02 12:04:15 +02:00
Thiago Santos f7ec33009a tests: caps: add check for caps with features intersection
Checks that a caps without features doesn't intersect with
one that has features
2014-08-09 11:03:01 -03:00
Sebastian Rasmussen 4cf6a6e086 tests: Add missing unrefs of objects after use
Unreffing the objects returned by gst_bin_get_by_name() and
gst_pipeline_get_use() were missing in several tests, so add these.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734345
2014-08-06 13:47:11 +02:00
Sebastian Dröge fd14754921 utils: Fix unititialized variable compiler warning 2014-08-06 12:55:57 +02:00
Sebastian Rasmussen 2e4ce5caf6 tests: Add test verifying gst_element_link_pads_full()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=733119
2014-08-06 09:58:37 +02:00
Thiago Santos 0d5ddc96f2 Revert "tests: taglist: add basic test for taglists serialization"
This reverts commit 85d23d19b7.

There was already a gsttag.c tests file, this test has been merged
in it in the previous commit
2014-07-21 12:44:40 -03:00
Thiago Santos 4f32a74daf tests: tag: add the empty taglist serialization test
Adds the test to the appropriate and already existing file.
2014-07-21 12:40:47 -03:00
Thiago Santos 85d23d19b7 tests: taglist: add basic test for taglists serialization
Make sure it works with empty taglists
2014-07-21 11:42:05 -03:00
Thiago Santos b0b8908159 tests: gststructure: serialization of tag event structure
Adds a test that checks that the serialization of a tag event structure
works without problems

https://bugzilla.gnome.org/show_bug.cgi?id=733131
2014-07-21 11:42:05 -03:00
Sebastian Dröge 4f29ce3cb7 pipeline: Add unit test for resetting of the start time
Also check if this properly affects basesink elements to not
report the old start time but the real current position when
setting to PAUSED again.
2014-07-21 09:33:54 +02:00
Tim-Philipp Müller e10d54b8e2 tests: fix locking in gstpoll unit test
The mutex needs to be locked when g_cond_wait*() is
called.
2014-07-06 12:10:09 +01:00
Tim-Philipp Müller 14ae3cf56c tests: don't use post-GLib 2.32 API in bufferlist test
g_ptr_array_insert() is GLib >= 2.40
2014-07-02 08:41:44 +01:00
Tim-Philipp Müller 0e0e78e8af devicemonitor: don't fail when started without any filters
Just show all devices then.
2014-06-27 10:47:50 +01:00
Olivier Crête fc87c5df5e device: Add unit tests 2014-06-26 21:01:38 -04:00
Tim-Philipp Müller ddd5e30726 tests: add another buffer list test case 2014-06-26 14:16:20 +01:00
Tim-Philipp Müller 9823a5f7b4 tests: port and re-enable buffer list tests
And remove some which don't apply any more.
2014-06-26 14:16:16 +01:00
George Kiagiadakis 4376ba4e3c tests: enhance the gstcaps test_features to also test gst_caps_set_features()
Compliments my previous patch for gst_caps_set_features, which would
previously assert and leak the old GstCapsFeatures if the caps already
had a GstCapsFeatures and you were trying to replace it with a new one.
2014-06-26 11:58:04 +03:00
Tim-Philipp Müller 39b69d27da tests: add unit test for gst_caps_is_any() and _is_empty()
https://bugzilla.gnome.org//show_bug.cgi?id=731704
2014-06-22 12:52:01 +01:00
Tim-Philipp Müller 4043fc3a44 tests: fix compiler warnings in gstvalue tests
Calling GST_VALUE_HOLDS_*(&v) now results in a compiler
warning about value!=NULL always being false, so check
type directly in those cases.
2014-06-21 01:10:22 +01:00
Sebastian Dröge 9b7da39b68 value: Make sure to cast int range values to guints before storing them
Otherwise negative values will sets all of the 64 bits due to two's
complement's definition of negative values.

Also add a test for negative int ranges.
2014-06-19 09:33:54 +02:00
Tim-Philipp Müller 5c62bce85c tests: remove some cruft from the bufferlist test
Buffers no longer carry caps, and bufferlists don't have
groups where buffers may need to be merged into one any more.
2014-06-17 14:39:00 +01:00
Tim-Philipp Müller b314ac8291 tests: add test for gst_buffer_list_remove() 2014-06-16 20:30:32 +01:00
Thiago Santos 1911554cff element: set pads need-parent flag to false when removing
When a pad is added the need-parent flag is set to true, so when
they are removed the flag should be set back to false

This was preventing GstPads to be reused in elements (removed and
later re-added). A unit tests was added to verify that this is
working now.

The use case is tsdemux that has a program-number property and
allows the user to switch programs. In order to do that tsdemux
will remove the pads of the current program and add from the new
ones. The removed pads are kept in the demuxer for later if the
user selects the old program again.
2014-05-29 17:01:20 -03:00
Thiago Santos c6f92562b6 pad: store last flow return and provide acessor function
Stores the last result of a gst_pad_push or a pull on the GstPad and provides
a getter and a macro to access this field.

Whenever the pad is inactive it is set to FLUSHING

API: gst_pad_get_last_flow_return

https://bugzilla.gnome.org/show_bug.cgi?id=709224
2014-05-26 15:29:53 -03:00
Nicolas Dufresne 103a40b6ce bufferpool: Add method and virtuals to set flushing state
Currently there is no other way to unlock a buffer pool other then
stopping it. This may have the effect of freeing all the buffers,
which is too heavy for a seek. This patch add a method to enter and
leave flushing state. As a convenience, flush_start/flush_stop
virtual are added so pool implementation can also unblock their own
internal poll atomically with the rest of the pool.  This is fully
backward compatible with doing stop/start to actually flush the pool
(as being done in GstBaseSrc).

https://bugzilla.gnome.org/show_bug.cgi?id=727611
2014-05-26 13:31:21 -04:00
Sebastian Dröge f2cb36b995 value: Add some positive testcase for string deserialization 2014-05-19 11:05:12 +02:00
Nicolas Dufresne 194db480e0 bufferpool: Add an helper to validate config
When we call gst_buffer_pool_set_config() the pool may return FALSE and
slightly change the parameters. This helper is useful to do the minial required
validation before accepting the modified configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=727916
2014-05-08 13:11:14 -04:00
Nicolas Dufresne 6079666a71 bufferpool: Add support for reconfiguring a pool
If a pool config is being configured again, check if the configuration have changed.
If not, skip that step. Finally, if the pool is active, try deactivating it.

https://bugzilla.gnome.org/show_bug.cgi?id=728268
2014-05-08 13:08:21 -04:00
Nicolas Dufresne 64aa64cb80 value: Add support for GstAllocationParams comparision
This is useful to compare buffer pool configuaration.

https://bugzilla.gnome.org/show_bug.cgi?id=728268
2014-05-08 13:08:21 -04:00
Nicolas Dufresne 00614e2c2b value: Add support for GObject comparising in structures
This is useful to allow comparing pool configuration where a GstAllocator
is set.

https://bugzilla.gnome.org/show_bug.cgi?id=728268
2014-05-08 13:08:21 -04:00
Jan Schmidt 4d7d3a1c02 Fix extended message handling with gst_bus_pop_timed_filtered()
Make sure extended message types don't get accidentally matched
when not asked for in the mask
2014-03-17 06:29:27 +11:00
Tim-Philipp Müller 1b7c5c4d64 tests: add test for extended message types and gst_bus_timed_pop_filtered 2014-03-16 14:38:07 +00:00
Wim Taymans 7691150c45 bufferpool: only release buffers with writable memory
Check if the memory is writable before releasing the buffer into the
pool again.
Add unit test for this scenario.
2014-02-27 16:40:34 +01:00