rtpulpfec: stop and start the harness when setting error-after
authorJonny Lamb <jonnylamb@jonnylamb.com>
Mon, 17 Dec 2018 18:04:37 +0000 (18:04 +0000)
committerMathieu Duponchelle <mduponchelle1@gmail.com>
Tue, 18 Dec 2018 12:32:48 +0000 (12:32 +0000)
gstreamer!55 makes some changes to how the `error-after` counter works
which breaks this test. This change makes the test not rely on the
ability to alter `error-after` at runtime and explicitly stops and
starts the harness before pushing data.

An alternative would be to add another argument to
`harness_rtpulpfecdec` to set `error-after` on construction but that's
slightly more long-winded. so I went for this approach instead.

Fixes #532, even though that's already closed.

tests/check/elements/rtpulpfec.c

index 57de5cd..f5f9e86 100644 (file)
@@ -515,7 +515,12 @@ GST_START_TEST (rtpulpfecdec_recovered_push_failed)
   GstHarness *h = harness_rtpulpfecdec (3536077562, 100, 123);
   RecoveredPacketInfo info = {.pt = 100,.ssrc = 3536077562,.seq = 36921 };
   GList *expected = expect_recovered_packets (h, &info, 1);
+
+  // the harness is already PLAYING because there are no src pads, which
+  // means the error-after counter isn't set, so reset and start again.
+  gst_element_set_state (h->element, GST_STATE_NULL);
   gst_harness_set (h, "identity", "error-after", 2, NULL);
+  gst_harness_play (h);
 
   push_data (h, SAMPLE_ULPFEC0_FEC, sizeof (SAMPLE_ULPFEC0_FEC) - 1);
   push_lost_event (h, 36921, 1111, 2222, FALSE);