tests: init/deinit per test case

... in order to verify init/deinit pair.
This commit is contained in:
Seungha Yang 2019-01-28 11:24:29 +09:00
parent 2f491b60c8
commit 78b38f26a7
20 changed files with 441 additions and 132 deletions

View file

@ -51,6 +51,7 @@ GST_START_TEST (test_basic)
g_main_loop_run (mainloop);
g_main_loop_unref (mainloop);
ges_deinit ();
}
GST_END_TEST;
@ -96,6 +97,7 @@ GST_START_TEST (test_transition_change_asset)
fail_unless_equals_int (GES_TRANSITION_CLIP (extractable)->vtype, 26);
gst_object_unref (extractable);
ges_deinit ();
}
GST_END_TEST;
@ -104,16 +106,21 @@ GST_START_TEST (test_uri_clip_change_asset)
{
GESAsset *asset, *asset1;
GESExtractable *extractable;
GESLayer *layer = ges_layer_new ();
gchar *uri = ges_test_file_uri ("audio_video.ogg");
gchar *uri1 = ges_test_file_uri ("audio_only.ogg");
GESTimeline *timeline = ges_timeline_new_audio_video ();
ges_timeline_add_layer (timeline, layer);
GESLayer *layer;
gchar *uri;
gchar *uri1;
GESTimeline *timeline;
gst_init (NULL, NULL);
ges_init ();
layer = ges_layer_new ();
uri = ges_test_file_uri ("audio_video.ogg");
uri1 = ges_test_file_uri ("audio_only.ogg");
timeline = ges_timeline_new_audio_video ();
ges_timeline_add_layer (timeline, layer);
asset = GES_ASSET (ges_uri_clip_asset_request_sync (uri, NULL));
fail_unless (GES_IS_ASSET (asset));
@ -136,6 +143,8 @@ GST_START_TEST (test_uri_clip_change_asset)
g_free (uri);
g_free (uri1);
ges_deinit ();
}
GST_END_TEST;
@ -144,6 +153,9 @@ GST_START_TEST (test_list_asset)
{
GList *assets;
GEnumClass *enum_class;
ges_init ();
enum_class = g_type_class_peek (GES_VIDEO_STANDARD_TRANSITION_TYPE_TYPE);
fail_unless (ges_init ());
@ -153,6 +165,8 @@ GST_START_TEST (test_list_asset)
/* note: we do not have a a for value=0 "Transition not set" */
assert_equals_int (g_list_length (assets), enum_class->n_values - 1);
g_list_free (assets);
ges_deinit ();
}
GST_END_TEST;
@ -196,6 +210,8 @@ GST_START_TEST (test_proxy_asset)
gst_object_unref (identity);
gst_object_unref (nothing_at_all);
ges_deinit ();
}
GST_END_TEST;
@ -206,12 +222,7 @@ ges_suite (void)
Suite *s = suite_create ("ges");
TCase *tc_chain = tcase_create ("a");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
ges_init ();
/* Must be first until we implement deinit */
tcase_add_test (tc_chain, test_list_asset);

View file

@ -27,10 +27,14 @@ GST_START_TEST (test_test_source_basic)
{
GESTestClip *source;
ges_init ();
source = ges_test_clip_new ();
fail_unless (source != NULL);
gst_object_unref (source);
ges_deinit ();
}
GST_END_TEST;
@ -43,6 +47,8 @@ GST_START_TEST (test_test_source_properties)
GESLayer *layer;
GESTrackElement *trackelement;
ges_init ();
track = ges_track_new (GES_TRACK_TYPE_AUDIO, gst_caps_ref (GST_CAPS_ANY));
fail_unless (track != NULL);
@ -111,6 +117,8 @@ GST_START_TEST (test_test_source_properties)
ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement));
gst_object_unref (clip);
ges_deinit ();
}
GST_END_TEST;
@ -125,6 +133,8 @@ GST_START_TEST (test_test_source_in_layer)
GESVideoTestPattern ptrn;
gdouble freq, volume;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
a = GES_TRACK (ges_audio_track_new ());
@ -195,6 +205,8 @@ GST_START_TEST (test_test_source_in_layer)
GST_DEBUG ("removing the layer");
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -395,11 +407,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-backgroundsource");
TCase *tc_chain = tcase_create ("backgroundsource");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_test_source_basic);

View file

@ -139,6 +139,8 @@ GST_START_TEST (test_ges_scenario)
/* Finally clean up our object */
ASSERT_OBJECT_REFCOUNT (timeline, "timeline", 1);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -253,6 +255,8 @@ GST_START_TEST (test_ges_timeline_add_layer)
/* theoretically this is all we need to do to ensure cleanup */
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -267,6 +271,8 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
GESTestClip *s1, *s2, *s3;
GList *trackelements, *tmp, *layers;
ges_init ();
/* Timeline and 1 Layer */
GST_DEBUG ("Create a timeline");
timeline = ges_timeline_new ();
@ -354,6 +360,8 @@ GST_START_TEST (test_ges_timeline_add_layer_first)
/* theoretically this is all we need to do to ensure cleanup */
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -367,6 +375,8 @@ GST_START_TEST (test_ges_timeline_remove_track)
GESTrackElement *t1, *t2, *t3;
GList *trackelements, *tmp, *layers;
ges_init ();
/* Timeline and 1 Layer */
GST_DEBUG ("Create a timeline");
timeline = ges_timeline_new ();
@ -489,6 +499,8 @@ GST_START_TEST (test_ges_timeline_remove_track)
gst_check_objects_destroyed_on_unref (G_OBJECT (timeline),
G_OBJECT (layer), t1, t2, t3, NULL);
ges_deinit ();
}
GST_END_TEST;
@ -525,6 +537,8 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
GList *trackelements, *tmp, *layers;
SelectTracksData st_data = { &s1, &s2, &s3, &track1, &track2 };
ges_init ();
/* Timeline and 1 Layer */
GST_DEBUG ("Create a timeline");
timeline = ges_timeline_new ();
@ -655,6 +669,8 @@ GST_START_TEST (test_ges_timeline_multiple_tracks)
gst_object_unref (t3);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -667,6 +683,8 @@ GST_START_TEST (test_ges_pipeline_change_state)
GESTimeline *timeline;
GESPipeline *pipeline;
ges_init ();
layer = ges_layer_new ();
timeline = ges_timeline_new_audio_video ();
fail_unless (ges_timeline_add_layer (timeline, layer));
@ -687,6 +705,8 @@ GST_START_TEST (test_ges_pipeline_change_state)
GST_STATE_CHANGE_SUCCESS);
gst_object_unref (pipeline);
ges_deinit ();
}
GST_END_TEST;
@ -698,6 +718,8 @@ GST_START_TEST (test_ges_timeline_element_name)
GESTimeline *timeline;
GESLayer *layer;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
fail_unless (ges_timeline_add_layer (timeline, layer));
@ -749,6 +771,8 @@ GST_START_TEST (test_ges_timeline_element_name)
gst_object_unref (clip4);
gst_object_unref (clip5);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -759,12 +783,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-basic");
TCase *tc_chain = tcase_create ("basic");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_ges_scenario);

View file

@ -30,6 +30,8 @@ GST_START_TEST (test_object_properties)
GESLayer *layer;
GESTrackElement *trackelement;
ges_init ();
track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
@ -97,6 +99,8 @@ GST_START_TEST (test_object_properties)
GES_TIMELINE_ELEMENT (trackelement));
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -114,6 +118,8 @@ GST_START_TEST (test_split_direct_bindings)
GESTrackElement *element;
ges_init ();
fail_unless ((timeline = ges_timeline_new ()));
fail_unless ((layer = ges_layer_new ()));
fail_unless (ges_timeline_add_track (timeline,
@ -181,6 +187,8 @@ GST_START_TEST (test_split_direct_bindings)
CHECK_OBJECT_PROPS (clip, 0 * GST_SECOND, 10 * GST_SECOND, 5 * GST_SECOND);
check_layer (clip, 0);
ges_deinit ();
}
GST_END_TEST;
@ -198,6 +206,8 @@ GST_START_TEST (test_split_direct_absolute_bindings)
GESTrackElement *element;
ges_init ();
fail_unless ((timeline = ges_timeline_new ()));
fail_unless ((layer = ges_layer_new ()));
fail_unless (ges_timeline_add_track (timeline,
@ -265,6 +275,8 @@ GST_START_TEST (test_split_direct_absolute_bindings)
CHECK_OBJECT_PROPS (clip, 0 * GST_SECOND, 10 * GST_SECOND, 5 * GST_SECOND);
check_layer (clip, 0);
ges_deinit ();
}
GST_END_TEST;
@ -278,6 +290,8 @@ GST_START_TEST (test_split_object)
GList *splittrackelements;
GESTrackElement *trackelement, *splittrackelement;
ges_init ();
layer = ges_layer_new ();
fail_unless (layer != NULL);
timeline = ges_timeline_new_audio_video ();
@ -355,6 +369,8 @@ GST_START_TEST (test_split_object)
check_destroyed (G_OBJECT (timeline), G_OBJECT (splitclip), clip,
splittrackelement, NULL);
ges_deinit ();
}
GST_END_TEST;
@ -369,6 +385,8 @@ GST_START_TEST (test_clip_group_ungroup)
GESContainer *regrouped_clip;
GESTrack *audio_track, *video_track;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
audio_track = GES_TRACK (ges_audio_track_new ());
@ -479,6 +497,8 @@ GST_START_TEST (test_clip_group_ungroup)
g_list_free_full (tmp, gst_object_unref);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -499,6 +519,8 @@ GST_START_TEST (test_clip_refcount_remove_child)
gboolean called;
GESTrackElement *effect;
ges_init ();
clip = GES_CLIP (ges_test_clip_new ());
track = GES_TRACK (ges_audio_track_new ());
effect = GES_TRACK_ELEMENT (ges_effect_new ("identity"));
@ -519,6 +541,8 @@ GST_START_TEST (test_clip_refcount_remove_child)
check_destroyed (G_OBJECT (track), NULL, NULL);
check_destroyed (G_OBJECT (clip), NULL, NULL);
ges_deinit ();
}
GST_END_TEST;
@ -532,6 +556,8 @@ GST_START_TEST (test_clip_find_track_element)
GESTrackElement *effect, *effect1, *effect2, *foundelem;
ges_init ();
clip = GES_CLIP (ges_test_clip_new ());
track = GES_TRACK (ges_audio_track_new ());
track1 = GES_TRACK (ges_audio_track_new ());
@ -583,6 +609,8 @@ GST_START_TEST (test_clip_find_track_element)
g_list_free_full (foundelements, gst_object_unref);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -596,6 +624,8 @@ GST_START_TEST (test_effects_priorities)
GESTrackElement *effect, *effect1, *effect2;
ges_init ();
clip = GES_CLIP (ges_test_clip_new ());
audio_track = GES_TRACK (ges_audio_track_new ());
video_track = GES_TRACK (ges_video_track_new ());
@ -673,6 +703,8 @@ GST_START_TEST (test_effects_priorities)
_PRIORITY (effect2));
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -683,12 +715,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-clip");
TCase *tc_chain = tcase_create ("clip");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_object_properties);

View file

@ -29,9 +29,13 @@ GST_START_TEST (test_effect_basic)
{
GESEffect *effect;
ges_init ();
effect = ges_effect_new ("agingtv");
fail_unless (effect != NULL);
gst_object_unref (effect);
ges_deinit ();
}
GST_END_TEST;
@ -44,6 +48,8 @@ GST_START_TEST (test_add_effect_to_clip)
GESEffect *effect;
GESTestClip *source;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_audio = GES_TRACK (ges_audio_track_new ());
@ -74,6 +80,8 @@ GST_START_TEST (test_add_effect_to_clip)
ges_layer_remove_clip (layer, (GESClip *) source);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -89,6 +97,8 @@ GST_START_TEST (test_get_effects_from_tl)
GList *effects, *tmp = NULL;
gint effect_prio = -1;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_video = GES_TRACK (ges_video_track_new ());
@ -160,6 +170,8 @@ GST_START_TEST (test_get_effects_from_tl)
ges_layer_remove_clip (layer, (GESClip *) source);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -180,6 +192,8 @@ GST_START_TEST (test_effect_clip)
GES_TRACK_TYPE_AUDIO
};
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_audio = GES_TRACK (ges_audio_track_new ());
@ -231,6 +245,8 @@ GST_START_TEST (test_effect_clip)
ges_layer_remove_clip (layer, (GESClip *) effect_clip);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -246,6 +262,8 @@ GST_START_TEST (test_priorities_clip)
gint effect_prio = -1;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_audio = GES_TRACK (ges_audio_track_new ());
@ -342,6 +360,8 @@ GST_START_TEST (test_priorities_clip)
ges_layer_remove_clip (layer, (GESClip *) effect_clip);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -359,6 +379,8 @@ GST_START_TEST (test_effect_set_properties)
GValue val = { 0 };
GValue nval = { 0 };
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_video = GES_TRACK (ges_video_track_new ());
@ -412,6 +434,8 @@ GST_START_TEST (test_effect_set_properties)
ges_layer_remove_clip (layer, (GESClip *) effect_clip);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -444,6 +468,8 @@ GST_START_TEST (test_clip_signals)
GValue val = { 0, };
gboolean effect_added = FALSE;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_video = GES_TRACK (ges_video_track_new ());
@ -482,6 +508,8 @@ GST_START_TEST (test_clip_signals)
ges_layer_remove_clip (layer, (GESClip *) effect_clip);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -495,6 +523,8 @@ GST_START_TEST (test_split_clip_effect_priorities)
GESEffect *effect;
GESTrackElement *source, *nsource, *neffect;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_video = GES_TRACK (ges_video_track_new ());
@ -534,6 +564,8 @@ GST_START_TEST (test_split_clip_effect_priorities)
assert_equals_uint64 (GES_TIMELINE_ELEMENT_PRIORITY (nsource), 6);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -545,12 +577,6 @@ ges_suite (void)
Suite *s = suite_create ("ges");
TCase *tc_chain = tcase_create ("effect");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_effect_basic);

View file

@ -32,6 +32,8 @@ GST_START_TEST (test_move_group)
GList *clips = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_timeline_append_layer (timeline);
@ -308,6 +310,8 @@ GST_START_TEST (test_move_group)
ASSERT_OBJECT_REFCOUNT (group, "2 ref for the timeline", 2);
check_destroyed (G_OBJECT (timeline), G_OBJECT (group), NULL);
gst_object_unref (asset);
ges_deinit ();
}
GST_END_TEST;
@ -332,6 +336,8 @@ GST_START_TEST (test_group_in_group)
guint nb_layer_notifies = 0;
GList *clips = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
/* Our timeline
@ -487,6 +493,8 @@ GST_START_TEST (test_group_in_group)
gst_object_unref (timeline);
gst_object_unref (asset);
ges_deinit ();
}
GST_END_TEST;
@ -511,6 +519,8 @@ GST_START_TEST (test_group_in_group_layer_moving)
GList *clips = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
/* Our timeline
@ -622,6 +632,8 @@ GST_START_TEST (test_group_in_group_layer_moving)
gst_object_unref (timeline);
gst_object_unref (asset);
ges_deinit ();
}
GST_END_TEST;
@ -637,6 +649,8 @@ GST_START_TEST (test_group_in_self)
GList *clips = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_timeline_append_layer (timeline);
@ -659,6 +673,8 @@ GST_START_TEST (test_group_in_self)
gst_object_unref (timeline);
gst_object_unref (asset);
ges_deinit ();
}
GST_END_TEST;
@ -685,6 +701,8 @@ GST_START_TEST (test_group_serialization)
GError *err = NULL;
GList *tmp, *clips = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_timeline_append_layer (timeline);
@ -744,6 +762,8 @@ GST_START_TEST (test_group_serialization)
g_free (tmpuri);
ges_deinit ();
}
GST_END_TEST;
@ -754,11 +774,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-group");
TCase *tc_chain = tcase_create ("group");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_move_group);

View file

@ -31,6 +31,8 @@ GST_START_TEST (test_layer_properties)
GESTrackElement *trackelement;
GESClip *clip;
ges_init ();
/* Timeline and 1 Layer */
timeline = ges_timeline_new ();
@ -103,6 +105,8 @@ GST_START_TEST (test_layer_properties)
fail_unless (ges_timeline_remove_track (timeline, track));
fail_unless (ges_timeline_remove_layer (timeline, layer));
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -118,6 +122,8 @@ GST_START_TEST (test_layer_priorities)
guint prio1, prio2, prio3;
GList *objs;
ges_init ();
/* Timeline and 3 Layer */
timeline = ges_timeline_new ();
fail_unless ((layer1 = ges_timeline_append_layer (timeline)));
@ -228,6 +234,8 @@ GST_START_TEST (test_layer_priorities)
gst_object_unref (trackelement2);
gst_object_unref (trackelement3);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -238,6 +246,8 @@ GST_START_TEST (test_timeline_auto_transition)
GESTimeline *timeline;
GESLayer *layer, *layer1, *layer2;
ges_init ();
asset = ges_asset_request (GES_TYPE_TEST_CLIP, NULL, NULL);
fail_unless (GES_IS_ASSET (asset));
gst_object_unref (asset);
@ -288,6 +298,8 @@ GST_START_TEST (test_timeline_auto_transition)
fail_unless (ges_layer_get_auto_transition (layer2));
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -301,6 +313,8 @@ GST_START_TEST (test_single_layer_automatic_transition)
GESLayer *layer;
GESTimelineElement *src, *src1, *src2;
ges_init ();
asset = ges_asset_request (GES_TYPE_TEST_CLIP, NULL, NULL);
fail_unless (GES_IS_ASSET (asset));
@ -682,6 +696,8 @@ GST_START_TEST (test_single_layer_automatic_transition)
g_list_free_full (objects, gst_object_unref);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -695,6 +711,8 @@ GST_START_TEST (test_multi_layer_automatic_transition)
GESLayer *layer, *layer1;
GESTimelineElement *src, *src1, *src2, *src3;
ges_init ();
asset = ges_asset_request (GES_TYPE_TEST_CLIP, NULL, NULL);
fail_unless (GES_IS_ASSET (asset));
@ -1169,6 +1187,8 @@ GST_START_TEST (test_multi_layer_automatic_transition)
ASSERT_OBJECT_REFCOUNT (transition, "layer + timeline", 2);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -1182,6 +1202,8 @@ GST_START_TEST (test_layer_activate_automatic_transition)
GESClip *transition;
GESTimelineElement *src, *src1, *src2, *src3;
ges_init ();
asset = ges_asset_request (GES_TYPE_TEST_CLIP, NULL, NULL);
transition_asset =
ges_asset_request (GES_TYPE_TRANSITION_CLIP, "crossfade", NULL);
@ -1398,6 +1420,8 @@ GST_START_TEST (test_layer_activate_automatic_transition)
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -1408,6 +1432,8 @@ GST_START_TEST (test_layer_meta_string)
GESLayer *layer;
const gchar *result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1419,6 +1445,8 @@ GST_START_TEST (test_layer_meta_string)
(layer), "ges-test")) != NULL);
assert_equals_string (result, "blub");
ges_deinit ();
}
GST_END_TEST;
@ -1429,6 +1457,8 @@ GST_START_TEST (test_layer_meta_boolean)
GESLayer *layer;
gboolean result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1439,6 +1469,8 @@ GST_START_TEST (test_layer_meta_boolean)
(layer), "ges-test", &result));
fail_unless (result);
ges_deinit ();
}
GST_END_TEST;
@ -1449,6 +1481,8 @@ GST_START_TEST (test_layer_meta_int)
GESLayer *layer;
gint result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1459,6 +1493,8 @@ GST_START_TEST (test_layer_meta_int)
"ges-test", &result));
assert_equals_int (result, 1234);
ges_deinit ();
}
GST_END_TEST;
@ -1469,6 +1505,8 @@ GST_START_TEST (test_layer_meta_uint)
GESLayer *layer;
guint result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1479,6 +1517,8 @@ GST_START_TEST (test_layer_meta_uint)
(layer), "ges-test", &result));
assert_equals_int (result, 42);
ges_deinit ();
}
GST_END_TEST;
@ -1489,6 +1529,8 @@ GST_START_TEST (test_layer_meta_int64)
GESLayer *layer;
gint64 result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1499,6 +1541,8 @@ GST_START_TEST (test_layer_meta_int64)
"ges-test", &result));
assert_equals_int64 (result, 1234);
ges_deinit ();
}
GST_END_TEST;
@ -1509,6 +1553,8 @@ GST_START_TEST (test_layer_meta_uint64)
GESLayer *layer;
guint64 result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1519,6 +1565,8 @@ GST_START_TEST (test_layer_meta_uint64)
(layer), "ges-test", &result));
assert_equals_uint64 (result, 42);
ges_deinit ();
}
GST_END_TEST;
@ -1529,6 +1577,8 @@ GST_START_TEST (test_layer_meta_float)
GESLayer *layer;
gfloat result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1540,6 +1590,8 @@ GST_START_TEST (test_layer_meta_float)
"ges-test", &result));
assert_equals_float (result, 23.456f);
ges_deinit ();
}
GST_END_TEST;
@ -1550,6 +1602,8 @@ GST_START_TEST (test_layer_meta_double)
GESLayer *layer;
gdouble result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1563,6 +1617,8 @@ GST_START_TEST (test_layer_meta_double)
//TODO CHECK
assert_equals_float (result, 23.456);
ges_deinit ();
}
GST_END_TEST;
@ -1574,6 +1630,8 @@ GST_START_TEST (test_layer_meta_date)
GDate *input;
GDate *result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1589,6 +1647,8 @@ GST_START_TEST (test_layer_meta_date)
g_date_free (input);
g_date_free (result);
ges_deinit ();
}
GST_END_TEST;
@ -1600,6 +1660,8 @@ GST_START_TEST (test_layer_meta_date_time)
GstDateTime *input;
GstDateTime *result = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1619,6 +1681,8 @@ GST_START_TEST (test_layer_meta_date_time)
gst_date_time_unref (input);
gst_date_time_unref (result);
ges_deinit ();
}
GST_END_TEST;
@ -1631,6 +1695,8 @@ GST_START_TEST (test_layer_meta_value)
GValue data = G_VALUE_INIT;
const GValue *result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1647,6 +1713,8 @@ GST_START_TEST (test_layer_meta_value)
assert_equals_string (g_value_get_string (result), "Hello world!");
g_value_unset (&data);
ges_deinit ();
}
GST_END_TEST;
@ -1657,6 +1725,8 @@ GST_START_TEST (test_layer_meta_register)
GESLayer *layer;
const gchar *result;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1674,6 +1744,8 @@ GST_START_TEST (test_layer_meta_register)
result = ges_meta_container_get_string (GES_META_CONTAINER (layer),
"ges-test-value");
assert_equals_string (result, "Hello world!");
ges_deinit ();
}
GST_END_TEST;
@ -1691,6 +1763,8 @@ GST_START_TEST (test_layer_meta_foreach)
GESTimeline *timeline;
GESLayer *layer;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1702,6 +1776,8 @@ GST_START_TEST (test_layer_meta_foreach)
ges_meta_container_foreach (GES_META_CONTAINER (layer),
(GESMetaForeachFunc) test_foreach, NULL);
ges_deinit ();
}
GST_END_TEST;
@ -1713,6 +1789,8 @@ GST_START_TEST (test_layer_get_clips_in_interval)
GESClip *clip, *clip2, *clip3;
GList *objects, *current;
ges_init ();
timeline = ges_timeline_new_audio_video ();
layer = ges_layer_new ();
ges_timeline_add_layer (timeline, layer);
@ -1816,6 +1894,7 @@ GST_START_TEST (test_layer_get_clips_in_interval)
fail_unless (current->data == GES_TIMELINE_ELEMENT (clip2));
g_list_free_full (objects, gst_object_unref);
ges_deinit ();
}
GST_END_TEST;
@ -1826,12 +1905,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-layer");
TCase *tc_chain = tcase_create ("timeline-layer");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_layer_properties);

View file

@ -30,8 +30,13 @@ GST_START_TEST (simple_smart_adder_test)
{
GstPad *requested_pad;
GstPadTemplate *template = NULL;
GESTrack *track = GES_TRACK (ges_audio_track_new ());
GstElement *smart_adder = ges_smart_adder_new (track);
GESTrack *track;
GstElement *smart_adder;
ges_init ();
track = GES_TRACK (ges_audio_track_new ());
smart_adder = ges_smart_adder_new (track);
fail_unless (GES_IS_SMART_ADDER (smart_adder));
fail_unless (GST_IS_ELEMENT (smart_adder));
@ -48,6 +53,8 @@ GST_START_TEST (simple_smart_adder_test)
gst_object_unref (smart_adder);
gst_object_unref (track);
ges_deinit ();
}
GST_END_TEST;
@ -85,9 +92,15 @@ GST_START_TEST (simple_audio_mixed_with_pipeline)
GESClip *tmpclip;
GstMessage *message;
GESLayer *layer, *layer1;
GESTrack *track = GES_TRACK (ges_audio_track_new ());
GESTimeline *timeline = ges_timeline_new ();
GESPipeline *pipeline = ges_test_create_pipeline (timeline);
GESTrack *track;
GESTimeline *timeline;
GESPipeline *pipeline;
ges_init ();
track = GES_TRACK (ges_audio_track_new ());
timeline = ges_timeline_new ();
pipeline = ges_test_create_pipeline (timeline);
ges_timeline_add_track (timeline, track);
layer = ges_timeline_append_layer (timeline);
@ -136,6 +149,8 @@ done:
gst_object_unref (bus);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
gst_object_unref (pipeline);
ges_deinit ();
}
GST_END_TEST;
@ -147,10 +162,17 @@ GST_START_TEST (audio_video_mixed_with_pipeline)
GESClip *tmpclip;
GstMessage *message;
GESLayer *layer, *layer1;
GESTrack *track = GES_TRACK (ges_video_track_new ());
GESTrack *track_audio = GES_TRACK (ges_audio_track_new ());
GESTimeline *timeline = ges_timeline_new ();
GESPipeline *pipeline = ges_test_create_pipeline (timeline);
GESTrack *track;
GESTrack *track_audio;
GESTimeline *timeline;
GESPipeline *pipeline;
ges_init ();
track = GES_TRACK (ges_video_track_new ());
track_audio = GES_TRACK (ges_audio_track_new ());
timeline = ges_timeline_new ();
pipeline = ges_test_create_pipeline (timeline);
ges_timeline_add_track (timeline, track);
ges_timeline_add_track (timeline, track_audio);
@ -196,6 +218,8 @@ done:
gst_object_unref (bus);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
gst_object_unref (pipeline);
ges_deinit ();
}
GST_END_TEST;
@ -206,11 +230,6 @@ ges_suite (void)
Suite *s = suite_create ("Smart mixers");
TCase *tc_chain = tcase_create ("smart-mixers");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
ges_init ();
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, simple_smart_adder_test);

View file

@ -25,10 +25,14 @@ GST_START_TEST (test_overlay_basic)
{
GESTextOverlayClip *source;
ges_init ();
source = ges_text_overlay_clip_new ();
fail_unless (source != NULL);
gst_object_unref (source);
ges_deinit ();
}
GST_END_TEST;
@ -41,6 +45,8 @@ GST_START_TEST (test_overlay_properties)
GESLayer *layer;
GESTrackElement *trackelement;
ges_init ();
track = ges_track_new (GES_TRACK_TYPE_VIDEO, gst_caps_ref (GST_CAPS_ANY));
fail_unless (track != NULL);
layer = ges_layer_new ();
@ -97,6 +103,8 @@ GST_START_TEST (test_overlay_properties)
ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement));
gst_object_unref (clip);
ges_deinit ();
}
GST_END_TEST;
@ -114,6 +122,8 @@ GST_START_TEST (test_overlay_in_layer)
gdouble xpos;
gdouble ypos;
ges_init ();
timeline = ges_timeline_new ();
layer = (GESLayer *) ges_layer_new ();
a = GES_TRACK (ges_audio_track_new ());
@ -191,6 +201,8 @@ GST_START_TEST (test_overlay_in_layer)
gst_object_unref (track_element);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -201,12 +213,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-overlays");
TCase *tc_chain = tcase_create ("overlays");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_overlay_basic);

View file

@ -61,6 +61,8 @@ GST_START_TEST (test_project_simple)
g_main_loop_unref (mainloop);
g_signal_handlers_disconnect_by_func (project, (GCallback) project_loaded_cb,
mainloop);
ges_deinit ();
}
GST_END_TEST;
@ -124,6 +126,8 @@ GST_START_TEST (test_project_add_assets)
gst_object_unref (project);
ASSERT_OBJECT_REFCOUNT (asset, "The asset (1 ref in cache)", 1);
ASSERT_OBJECT_REFCOUNT (project, "The project (1 ref in cache)", 1);
ges_deinit ();
}
GST_END_TEST;
@ -173,6 +177,7 @@ GST_START_TEST (test_project_unexistant_effect)
ASSERT_OBJECT_REFCOUNT (project, "The project (1 ref in cache)", 1);
ges_deinit ();
}
GST_END_TEST;
@ -426,8 +431,11 @@ GST_START_TEST (test_project_add_properties)
GESTimeline *timeline;
GESAsset *formatter_asset;
gboolean saved;
gchar *uri = ges_test_file_uri ("test-properties.xges");
gchar *uri;
ges_init ();
uri = ges_test_file_uri ("test-properties.xges");
project = ges_project_new (uri);
mainloop = g_main_loop_new (NULL, FALSE);
@ -479,6 +487,8 @@ GST_START_TEST (test_project_add_properties)
mainloop);
g_signal_handlers_disconnect_by_func (project, (GCallback) asset_added_cb,
NULL);
ges_deinit ();
}
GST_END_TEST;
@ -489,8 +499,11 @@ GST_START_TEST (test_project_load_xges)
GESProject *loaded_project, *saved_project;
GESTimeline *timeline;
GESAsset *formatter_asset;
gchar *uri = ges_test_file_uri ("test-project.xges");
gchar *uri;
ges_init ();
uri = ges_test_file_uri ("test-project.xges");
loaded_project = ges_project_new (uri);
mainloop = g_main_loop_new (NULL, FALSE);
fail_unless (GES_IS_PROJECT (loaded_project));
@ -557,6 +570,8 @@ GST_START_TEST (test_project_load_xges)
(GCallback) project_loaded_cb, mainloop);
g_signal_handlers_disconnect_by_func (saved_project,
(GCallback) asset_added_cb, NULL);
ges_deinit ();
}
GST_END_TEST;
@ -569,8 +584,11 @@ GST_START_TEST (test_project_auto_transition)
GESLayer *layer = NULL;
GESAsset *formatter_asset;
gboolean saved;
gchar *tmpuri, *uri = ges_test_file_uri ("test-auto-transition.xges");
gchar *tmpuri, *uri;
ges_init ();
uri = ges_test_file_uri ("test-auto-transition.xges");
project = ges_project_new (uri);
mainloop = g_main_loop_new (NULL, FALSE);
fail_unless (GES_IS_PROJECT (project));
@ -638,6 +656,8 @@ GST_START_TEST (test_project_auto_transition)
mainloop);
g_signal_handlers_disconnect_by_func (project, (GCallback) asset_added_cb,
NULL);
ges_deinit ();
}
GST_END_TEST;
@ -734,12 +754,7 @@ ges_suite (void)
Suite *s = suite_create ("ges-project");
TCase *tc_chain = tcase_create ("project");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
ges_init ();
tcase_add_test (tc_chain, test_project_simple);
tcase_add_test (tc_chain, test_project_add_assets);

View file

@ -33,6 +33,8 @@ GST_START_TEST (test_tempochange)
GList *tmp;
int found;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
track_audio = GES_TRACK (ges_audio_track_new ());
@ -120,6 +122,8 @@ GST_START_TEST (test_tempochange)
ges_layer_remove_clip (layer, clip3);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -132,12 +136,6 @@ ges_suite (void)
GstPluginFeature *pitch = gst_registry_find_feature (gst_registry_get (),
"pitch", GST_TYPE_ELEMENT_FACTORY);
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
if (pitch) {
gst_object_unref (pitch);

View file

@ -47,6 +47,8 @@ GST_START_TEST (test_basic_timeline_edition)
GESTrackElement *trackelement, *trackelement1, *trackelement2;
GESContainer *clip, *clip1, *clip2;
ges_init ();
track = GES_TRACK (ges_audio_track_new ());
fail_unless (track != NULL);
@ -230,6 +232,8 @@ GST_START_TEST (test_basic_timeline_edition)
CHECK_OBJECT_PROPS (trackelement2, 62, 0, 60);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -243,6 +247,8 @@ GST_START_TEST (test_snapping)
GESLayer *layer;
GList *trackelements;
ges_init ();
track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
@ -474,6 +480,8 @@ GST_START_TEST (test_snapping)
check_destroyed (G_OBJECT (timeline), G_OBJECT (trackelement),
trackelement1, trackelement2, clip, clip1, clip2, layer, NULL);
ges_deinit ();
}
GST_END_TEST;
@ -498,8 +506,11 @@ GST_START_TEST (test_simple_triming)
GESTimeline *timeline;
GESLayer *layer;
GESTimelineElement *element;
gchar *uri;
gchar *uri = ges_test_file_uri ("audio_video.ogg");
ges_init ();
uri = ges_test_file_uri ("audio_video.ogg");
project = ges_project_new (NULL);
@ -535,6 +546,8 @@ GST_START_TEST (test_simple_triming)
g_main_loop_unref (mainloop);
gst_object_unref (timeline);
gst_object_unref (project);
ges_deinit ();
}
GST_END_TEST;
@ -548,6 +561,8 @@ GST_START_TEST (test_timeline_edition_mode)
GESLayer *layer, *layer1, *layer2;
GList *trackelements, *layers, *tmp;
ges_init ();
track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
@ -969,6 +984,7 @@ GST_START_TEST (test_timeline_edition_mode)
CHECK_OBJECT_PROPS (trackelement1, 25, 5, 37);
CHECK_OBJECT_PROPS (trackelement2, 62, 0, 60);
ges_deinit ();
}
GST_END_TEST;
@ -983,6 +999,8 @@ GST_START_TEST (test_groups)
GList *clips = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
/* Our timeline
@ -1153,6 +1171,8 @@ GST_START_TEST (test_groups)
gst_object_unref (timeline);
gst_object_unref (asset);
ges_deinit ();
}
GST_END_TEST;
@ -1167,6 +1187,8 @@ GST_START_TEST (test_snapping_groups)
GList *clips = NULL;
ges_init ();
timeline = ges_timeline_new_audio_video ();
g_object_set (timeline, "snapping-distance", (guint64) 3, NULL);
@ -1249,6 +1271,8 @@ GST_START_TEST (test_snapping_groups)
gst_object_unref (timeline);
gst_object_unref (asset);
ges_deinit ();
}
GST_END_TEST;
@ -1307,8 +1331,13 @@ GST_START_TEST (test_scaling)
GESLayer *layer;
GESAsset *asset1, *asset2;
GESClip *clip;
GESTrack *trackv = GES_TRACK (ges_video_track_new ());
GstCaps *caps =
GESTrack *trackv;
GstCaps *caps;
ges_init ();
trackv = GES_TRACK (ges_video_track_new ());
caps =
gst_caps_new_simple ("video/x-raw", "width", G_TYPE_INT, 1200, "height",
G_TYPE_INT, 1000, NULL);
@ -1491,6 +1520,8 @@ GST_START_TEST (test_scaling)
fail_unless (check_frame_positioner_size (clip, 320, 240));
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -1501,12 +1532,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-timeline-edition");
TCase *tc_chain = tcase_create ("timeline-edition");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
ges_init ();
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_basic_timeline_edition);

View file

@ -25,10 +25,14 @@ GST_START_TEST (test_title_source_basic)
{
GESTitleClip *source;
ges_init ();
source = ges_title_clip_new ();
fail_unless (source != NULL);
gst_object_unref (source);
ges_deinit ();
}
GST_END_TEST;
@ -41,6 +45,8 @@ GST_START_TEST (test_title_source_properties)
GESLayer *layer;
GESTrackElement *trackelement;
ges_init ();
track = GES_TRACK (ges_video_track_new ());
fail_unless (track != NULL);
layer = ges_layer_new ();
@ -97,6 +103,8 @@ GST_START_TEST (test_title_source_properties)
ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement));
gst_object_unref (clip);
ges_deinit ();
}
GST_END_TEST;
@ -114,6 +122,8 @@ GST_START_TEST (test_title_source_in_layer)
gdouble xpos;
gdouble ypos;
ges_init ();
timeline = ges_timeline_new ();
layer = ges_layer_new ();
a = GES_TRACK (ges_audio_track_new ());
@ -195,6 +205,8 @@ GST_START_TEST (test_title_source_in_layer)
gst_object_unref (track_element);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -205,12 +217,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-titles");
TCase *tc_chain = tcase_create ("titles");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_title_source_basic);

View file

@ -41,6 +41,8 @@ GST_START_TEST (test_update_restriction_caps)
GstCaps *new;
GstCaps *current;
ges_init ();
track = GES_TRACK (ges_audio_track_new ());
original = gst_caps_from_string ("audio/x-raw, format=S32LE");
@ -83,6 +85,8 @@ GST_START_TEST (test_update_restriction_caps)
gst_caps_unref (new);
gst_caps_unref (original);
gst_caps_unref (current);
ges_deinit ();
}
GST_END_TEST;
@ -93,11 +97,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-track");
TCase *tc_chain = tcase_create ("track");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_update_restriction_caps);

View file

@ -33,6 +33,8 @@ GST_START_TEST (test_transition_basic)
GESTransitionClip *tr1, *tr2;
GESTrackElement *trackelement;
ges_init ();
track = GES_TRACK (ges_video_track_new ());
layer = ges_layer_new ();
timeline = ges_timeline_new ();
@ -60,6 +62,8 @@ GST_START_TEST (test_transition_basic)
(GES_VIDEO_TRANSITION (trackelement)) == 1);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -72,6 +76,8 @@ GST_START_TEST (test_transition_properties)
GESLayer *layer;
GESTrackElement *trackelement;
ges_init ();
clip = GES_CLIP (ges_transition_clip_new
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE));
@ -162,6 +168,8 @@ GST_START_TEST (test_transition_properties)
assert_equals_int (GES_TRANSITION_CLIP (clip)->vtype, 1);
check_destroyed (G_OBJECT (timeline), G_OBJECT (track), clip, NULL);
ges_deinit ();
}
GST_END_TEST;
@ -174,12 +182,6 @@ ges_suite (void)
Suite *s = suite_create ("ges-transition");
TCase *tc_chain = tcase_create ("transition");
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_transition_basic);

View file

@ -86,6 +86,8 @@ GST_START_TEST (test_filesource_basic)
mainloop = g_main_loop_new (NULL, FALSE);
ges_init ();
timeline = ges_timeline_new_audio_video ();
fail_unless (timeline != NULL);
@ -99,6 +101,8 @@ GST_START_TEST (test_filesource_basic)
g_main_loop_run (mainloop);
g_main_loop_unref (mainloop);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -123,6 +127,8 @@ GST_START_TEST (test_filesource_properties)
GESLayer *layer;
GESTrackElement *trackelement;
ges_init ();
track = ges_track_new (GES_TRACK_TYPE_AUDIO, gst_caps_ref (GST_CAPS_ANY));
fail_unless (track != NULL);
@ -195,6 +201,8 @@ GST_START_TEST (test_filesource_properties)
GES_TIMELINE_ELEMENT (trackelement));
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -210,6 +218,8 @@ GST_START_TEST (test_filesource_images)
GESLayer *layer;
GESTrackElement *track_element;
ges_init ();
a = GES_TRACK (ges_audio_track_new ());
v = GES_TRACK (ges_video_track_new ());
@ -255,6 +265,8 @@ GST_START_TEST (test_filesource_images)
4);
gst_object_unref (timeline);
ges_deinit ();
}
GST_END_TEST;
@ -284,12 +296,6 @@ main (int argc, char **argv)
gst_check_init (&argc, &argv);
ges_init ();
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
s = ges_suite ();
av_uri = ges_test_get_audio_video_uri ();

View file

@ -156,6 +156,8 @@ GST_START_TEST (test_one_space_another)
gboolean ret = FALSE;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -225,6 +227,8 @@ GST_START_TEST (test_one_space_another)
segment_new (1.0, GST_FORMAT_TIME, 0, 1 * GST_SECOND, 0));
fill_pipeline_and_check (comp, segments, GST_STREAM_ERROR);
ges_deinit ();
}
GST_END_TEST;
@ -235,6 +239,8 @@ GST_START_TEST (test_one_default_another)
GstElement *comp, *source1, *source2, *source3, *defaultsrc;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -342,6 +348,8 @@ GST_START_TEST (test_one_default_another)
4 * GST_SECOND, 5 * GST_SECOND, 4 * GST_SECOND));
fill_pipeline_and_check (comp, segments, GST_STREAM_ERROR);
ges_deinit ();
}
GST_END_TEST;
@ -352,6 +360,8 @@ GST_START_TEST (test_one_expandable_another)
GList *segments = NULL;
gboolean ret = FALSE;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -464,6 +474,8 @@ GST_START_TEST (test_one_expandable_another)
4 * GST_SECOND, 5 * GST_SECOND, 4 * GST_SECOND));
fill_pipeline_and_check (comp, segments, 0);
ges_deinit ();
}
GST_END_TEST;
@ -483,6 +495,8 @@ GST_START_TEST (test_renegotiation)
GstPad *sinkpad;
GstCaps *caps;
ges_init ();
pipeline = gst_pipeline_new ("test_pipeline");
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
@ -683,6 +697,8 @@ GST_START_TEST (test_renegotiation)
gst_object_unref (bus);
collect_free (collect);
ges_deinit ();
}
GST_END_TEST;
@ -694,6 +710,8 @@ GST_START_TEST (test_one_bin_space_another)
gboolean ret = FALSE;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -753,6 +771,8 @@ GST_START_TEST (test_one_bin_space_another)
segment_new (1.0, GST_FORMAT_TIME, 0, 1 * GST_SECOND, 0));
fill_pipeline_and_check (comp, segments, GST_STREAM_ERROR);
ges_deinit ();
}
GST_END_TEST;
@ -763,6 +783,8 @@ GST_START_TEST (test_one_above_another)
gboolean ret = FALSE;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -824,6 +846,8 @@ GST_START_TEST (test_one_above_another)
1 * GST_SECOND, 3 * GST_SECOND, 1 * GST_SECOND));
fill_pipeline_and_check (comp, segments, 0);
ges_deinit ();
}
GST_END_TEST;
@ -834,11 +858,6 @@ gnonlin_suite (void)
Suite *s = suite_create ("gnonlin-complex");
TCase *tc_chain = tcase_create ("complex");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
ges_init ();
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_one_space_another);

View file

@ -45,6 +45,8 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
GstMessage *message;
gboolean carry_on, ret = FALSE;
ges_init ();
pipeline = gst_pipeline_new ("test_pipeline");
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
@ -161,6 +163,8 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
gst_check_objects_destroyed_on_unref (pipeline, comp, def, NULL);
ASSERT_OBJECT_REFCOUNT_BETWEEN (bus, "main bus", 1, 2);
gst_object_unref (bus);
ges_deinit ();
}
GST_END_TEST;
@ -170,6 +174,8 @@ GST_START_TEST (test_remove_invalid_object)
GstBin *composition;
GstElement *source1, *source2;
ges_init ();
composition = GST_BIN (gst_element_factory_make ("nlecomposition",
"composition"));
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_READY);
@ -184,6 +190,8 @@ GST_START_TEST (test_remove_invalid_object)
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_NULL);
gst_object_unref (composition);
gst_object_unref (source2);
ges_deinit ();
}
GST_END_TEST;
@ -211,6 +219,8 @@ GST_START_TEST (test_remove_last_object)
gint64 position = 0;
GstClockTime duration;
ges_init ();
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
@ -295,6 +305,8 @@ GST_START_TEST (test_remove_last_object)
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
gst_object_unref (pipeline);
gst_object_unref (bus);
ges_deinit ();
}
GST_END_TEST;
@ -307,6 +319,8 @@ GST_START_TEST (test_dispose_on_commit)
GstElement *pipeline, *fakesink;
gboolean ret;
ges_init ();
composition = gst_element_factory_make ("nlecomposition", "composition");
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
fakesink = gst_element_factory_make ("fakesink", NULL);
@ -326,6 +340,8 @@ GST_START_TEST (test_dispose_on_commit)
g_signal_emit_by_name (composition, "commit", TRUE, &ret);
gst_object_unref (pipeline);
ges_deinit ();
}
GST_END_TEST;
@ -344,6 +360,8 @@ GST_START_TEST (test_simple_audiomixer)
gboolean carry_on = TRUE, ret;
GstClockTime total_time = 10 * GST_SECOND;
ges_init ();
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
@ -429,6 +447,8 @@ GST_START_TEST (test_simple_audiomixer)
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
gst_object_unref (bus);
gst_object_unref (pipeline);
ges_deinit ();
}
GST_END_TEST;
@ -439,11 +459,6 @@ gnonlin_suite (void)
Suite *s = suite_create ("nlecomposition");
TCase *tc_chain = tcase_create ("nlecomposition");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
ges_init ();
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_change_object_start_stop_in_current_stack);

View file

@ -134,6 +134,8 @@ GST_START_TEST (test_simple_operation)
GstElement *comp, *oper, *source;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -212,6 +214,8 @@ GST_START_TEST (test_simple_operation)
2 * GST_SECOND, 3 * GST_SECOND, 2 * GST_SECOND));
fill_pipeline_and_check (comp, segments);
ges_deinit ();
}
GST_END_TEST;
@ -222,6 +226,8 @@ GST_START_TEST (test_pyramid_operations)
gboolean ret = FALSE;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -304,6 +310,8 @@ GST_START_TEST (test_pyramid_operations)
8 * GST_SECOND, 10 * GST_SECOND, 8 * GST_SECOND));
fill_pipeline_and_check (comp, segments);
ges_deinit ();
}
GST_END_TEST;
@ -314,6 +322,8 @@ GST_START_TEST (test_pyramid_operations2)
GstElement *comp, *oper, *source1, *source2, *def;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -401,6 +411,8 @@ GST_START_TEST (test_pyramid_operations2)
5 * GST_SECOND, 6 * GST_SECOND, 5 * GST_SECOND));
fill_pipeline_and_check (comp, segments);
ges_deinit ();
}
GST_END_TEST;
@ -411,6 +423,8 @@ GST_START_TEST (test_pyramid_operations_expandable)
gboolean ret = FALSE;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -485,6 +499,8 @@ GST_START_TEST (test_pyramid_operations_expandable)
4 * GST_SECOND, 6 * GST_SECOND, 4 * GST_SECOND));
fill_pipeline_and_check (comp, segments);
ges_deinit ();
}
GST_END_TEST;
@ -496,6 +512,8 @@ GST_START_TEST (test_complex_operations)
gboolean ret = FALSE;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -580,6 +598,8 @@ GST_START_TEST (test_complex_operations)
4 * GST_SECOND, 6 * GST_SECOND, 4 * GST_SECOND));
fill_pipeline_and_check (comp, segments);
ges_deinit ();
}
GST_END_TEST;
@ -591,6 +611,8 @@ GST_START_TEST (test_complex_operations_bis)
gboolean ret;
GList *segments = NULL;
ges_init ();
comp =
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY);
@ -680,6 +702,8 @@ GST_START_TEST (test_complex_operations_bis)
0 * GST_SECOND, 2 * GST_SECOND, 4 * GST_SECOND));
fill_pipeline_and_check (comp, segments);
ges_deinit ();
}
GST_END_TEST;
@ -692,11 +716,6 @@ gnonlin_suite (void)
Suite *s = suite_create ("nleoperation");
TCase *tc_chain = tcase_create ("nleoperation");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
ges_init ();
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_simple_operation);

View file

@ -739,35 +739,45 @@ test_one_bin_after_other_full (void)
GST_START_TEST (test_simplest)
{
ges_init ();
test_simplest_full ();
ges_deinit ();
}
GST_END_TEST;
GST_START_TEST (test_time_duration)
{
ges_init ();
test_time_duration_full ();
ges_deinit ();
}
GST_END_TEST;
GST_START_TEST (test_one_after_other)
{
ges_init ();
test_one_after_other_full ();
ges_deinit ();
}
GST_END_TEST;
GST_START_TEST (test_one_under_another)
{
ges_init ();
test_one_under_another_full ();
ges_deinit ();
}
GST_END_TEST;
GST_START_TEST (test_one_bin_after_other)
{
ges_init ();
test_one_bin_after_other_full ();
ges_deinit ();
}
GST_END_TEST;
@ -778,14 +788,8 @@ gnonlin_suite (void)
Suite *s = suite_create ("gnonlin-simple");
TCase *tc_chain = tcase_create ("general");
if (atexit (ges_deinit) != 0) {
GST_ERROR ("failed to set ges_deinit as exit function");
}
suite_add_tcase (s, tc_chain);
ges_init ();
tcase_add_test (tc_chain, test_time_duration);
tcase_add_test (tc_chain, test_simplest);
tcase_add_test (tc_chain, test_one_after_other);