diff options
author | Alessandro Decina <alessandro.decina@collabora.co.uk> | 2010-08-19 15:10:25 +0200 |
---|---|---|
committer | Alessandro Decina <alessandro.decina@collabora.co.uk> | 2010-08-20 10:31:38 +0200 |
commit | 00b4bfa48f23e671b40c36e428ebfc224f0e3c9c (patch) | |
tree | ad9efabb9f8e0f9d8e70f3bfcab921e68d5416c9 /tests | |
parent | d246e0c592fa6222c2003c59b2dd1026b905933d (diff) |
gnlcomposition: fail early in remove_object when removing an invalid object.
Make gnl_composition_remove_object return immediately FALSE when removing an
object not contained in the composition.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/gnl/gnlcomposition.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/check/gnl/gnlcomposition.c b/tests/check/gnl/gnlcomposition.c index dcb4f1a..9063a1c 100644 --- a/tests/check/gnl/gnlcomposition.c +++ b/tests/check/gnl/gnlcomposition.c @@ -214,6 +214,25 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack) GST_END_TEST; +GST_START_TEST (test_remove_invalid_object) +{ + GstBin *composition; + GstElement *source1, *source2; + + composition = GST_BIN (gst_element_factory_make ("gnlcomposition", + "composition")); + source1 = gst_element_factory_make ("gnlsource", "source1"); + source2 = gst_element_factory_make ("gnlsource", "source2"); + + gst_bin_add (composition, source1); + fail_if (gst_bin_remove (composition, source2)); + fail_unless (gst_bin_remove (composition, source1)); + + gst_object_unref (composition); +} + +GST_END_TEST; + Suite * gnonlin_suite (void) { @@ -223,6 +242,7 @@ gnonlin_suite (void) suite_add_tcase (s, tc_chain); tcase_add_test (tc_chain, test_change_object_start_stop_in_current_stack); + tcase_add_test (tc_chain, test_remove_invalid_object); return s; } |