tests: Make sure gst_bin_add succeeds

And detect when we're trying to add contents to a gnlsource which
already has something
This commit is contained in:
Edward Hervey 2010-12-09 17:43:08 +01:00
parent ef7eb9efdd
commit a5261d23d2
4 changed files with 27 additions and 6 deletions

View file

@ -39,7 +39,12 @@ my_fill_track_func (GESTimelineObject * object,
/* Let's just put a fakesource in for the time being */
src = gst_element_factory_make ("fakesrc", NULL);
return gst_bin_add (GST_BIN (gnlobj), src);
/* If this fails... that means that there already was something
* in it */
fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
return TRUE;
}
GST_START_TEST (test_ges_scenario)

View file

@ -31,7 +31,12 @@ my_fill_track_func (GESTimelineObject * object,
/* Let's just put a fakesource in for the time being */
src = gst_element_factory_make ("fakesrc", NULL);
return gst_bin_add (GST_BIN (gnlobj), src);
/* If this fails... that means that there already was something
* in it */
fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
return TRUE;
}
#define gnl_object_check(gnlobj, start, duration, mstart, mduration, priority, active) { \

View file

@ -31,7 +31,12 @@ my_fill_track_func (GESTimelineObject * object,
/* Let's just put a fakesource in for the time being */
src = gst_element_factory_make ("fakesrc", NULL);
return gst_bin_add (GST_BIN (gnlobj), src);
/* If this fails... that means that there already was something
* in it */
fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
return TRUE;
}
static gboolean
@ -46,9 +51,11 @@ arbitrary_fill_track_func (GESTimelineObject * object,
user_data, object, trobject, gnlobj);
/* interpret user_data as name of element to create */
src = gst_element_factory_make (user_data, NULL);
gst_bin_add (GST_BIN (gnlobj), src);
/* If this fails... that means that there already was something
* in it */
fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
return TRUE;
}

View file

@ -31,7 +31,11 @@ my_fill_track_func (GESTimelineObject * object,
/* Let's just put a fakesource in for the time being */
src = gst_element_factory_make ("fakesrc", NULL);
return gst_bin_add (GST_BIN (gnlobj), src);
/* If this fails... that means that there already was something
* in it */
fail_unless (gst_bin_add (GST_BIN (gnlobj), src));
return TRUE;
}
#define gnl_object_check(gnlobj, start, duration, mstart, mduration, priority, active) { \