summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2014-05-06 16:37:24 +0200
committerThibault Saunier <tsaunier@gnome.org>2014-05-06 16:39:13 +0200
commit87413a0590132fe688b99d537123475c71e0e7c5 (patch)
treec4b2506890a9b2c8884ef2b8085292e7c97e8089
parent3ad14a665a302982b25f2f47fc1150704d7a26ec (diff)
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)
-rw-r--r--tests/check/gnl/common.c8
-rw-r--r--tests/check/gnl/common.h2
-rw-r--r--tests/check/gnl/seek.c1
3 files changed, 10 insertions, 1 deletions
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);