diff options
author | Vasilis Liaskovitis <vliaskov@gmail.com> | 2013-07-14 14:03:46 +0200 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@collabora.com> | 2013-07-16 21:32:40 -0400 |
commit | 68363433c918ef13e3ef5277d4991a9d78d6310f (patch) | |
tree | 4eb485f259d9677c055ef825c491d75712f09211 | |
parent | 393505b8aab5f1dfc269676cf081b9548036334e (diff) |
integration: some fixes for seek tests
- Use g_list_remove_link so that ordering of seeks is not mandatory
- use g_slice allocator for SeekInfo structs
- Fix leak in freeing seek list
- Check for NULL seeks at end of test, otherwise fail and free failed seeks
-rw-r--r-- | tests/check/ges/integration.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/check/ges/integration.c b/tests/check/ges/integration.c index bf5c1c2..bf4d4a4 100644 --- a/tests/check/ges/integration.c +++ b/tests/check/ges/integration.c @@ -68,7 +68,7 @@ static const gchar *test_image_filename = NULL; static SeekInfo * new_seek_info (GstClockTime seeking_position, GstClockTime position) { - SeekInfo *info = g_new0 (SeekInfo, 1); + SeekInfo *info = g_slice_new0 (SeekInfo); info->seeking_position = seeking_position; info->position = position; return info; @@ -223,8 +223,9 @@ get_position (void) GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, seek->position)); - seeks = seeks->next; - g_free (seek); + seeks = g_list_remove_link (seeks, tmp); + g_slice_free (SeekInfo, seek); + g_list_free (tmp); break; } tmp = tmp->next; @@ -324,6 +325,7 @@ test_seeking (gboolean render) GESUriClipAsset *asset1; GESEffect *effect; GESClip *clip; + GList *tmp; gchar *uri = ges_test_file_name (testfilename1); asset1 = ges_uri_clip_asset_request_sync (uri, &error); @@ -362,6 +364,21 @@ test_seeking (gboolean render) seeks = g_list_append (seeks, new_seek_info (1.5 * GST_SECOND, 1.8 * GST_SECOND)); fail_unless (test_timeline_with_profile (timeline, PROFILE_OGG, FALSE)); + if (seeks != NULL) { + /* free failed seeks */ + while (seeks) { + SeekInfo *info = seeks->data; + + tmp = seeks; + GST_ERROR ("Seeking at %" GST_TIME_FORMAT " to %" GST_TIME_FORMAT + " did not happen \n", GST_TIME_ARGS (info->seeking_position), + GST_TIME_ARGS (info->position)); + seeks = g_list_remove_link (seeks, tmp); + g_slice_free (SeekInfo, info); + g_list_free (tmp); + } + fail_if (TRUE, "Got EOS before being able to execute all seeks"); + } } /* Test adding an effect [E] marks the effect */ |