From 87413a0590132fe688b99d537123475c71e0e7c5 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 6 May 2014 16:37:24 +0200 Subject: tests: Add a flag about whether to keep expected segments or not Most test rely on the common helper to handles that, but for seeking tests it does not make sense to handle it that way (as in gnlcomposition we send 2 seeks when we get seek and thus we can received 2 times the same segment) --- tests/check/gnl/common.c | 8 +++++++- tests/check/gnl/common.h | 2 ++ tests/check/gnl/seek.c | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/check/gnl/common.c b/tests/check/gnl/common.c index 4417b7a..68c849b 100644 --- a/tests/check/gnl/common.c +++ b/tests/check/gnl/common.c @@ -126,7 +126,13 @@ sinkpad_event_probe (GstPad * sinkpad, GstEvent * event, segment = (Segment *) collect->expected_segments->data; - compare_segments (collect, segment, event); + if (compare_segments (collect, segment, event) && + collect->keep_expected_segments == FALSE) { + collect->expected_segments = + g_list_remove (collect->expected_segments, segment); + g_free (segment); + } + collect->gotsegment = TRUE; } diff --git a/tests/check/gnl/common.h b/tests/check/gnl/common.h index 7e0b3b5..b1d6d9e 100644 --- a/tests/check/gnl/common.h +++ b/tests/check/gnl/common.h @@ -46,6 +46,8 @@ typedef struct _CollectStructure { GList *seen_segments; GList *expected_segments; guint64 expected_base; + + gboolean keep_expected_segments; } CollectStructure; void poll_the_bus(GstBus *bus); diff --git a/tests/check/gnl/seek.c b/tests/check/gnl/seek.c index fea15f9..a3471d8 100644 --- a/tests/check/gnl/seek.c +++ b/tests/check/gnl/seek.c @@ -46,6 +46,7 @@ fill_pipeline_and_check (GstElement * comp, GList * segments, GList * seeks) /* Expected segments */ collect->expected_segments = segments; + collect->keep_expected_segments = TRUE; g_signal_connect (G_OBJECT (comp), "pad-added", G_CALLBACK (composition_pad_added_cb), collect); -- cgit v1.2.3