test: flvmux: Use gst_harness_sink_push_many

And check its return value.
This commit is contained in:
Jan Alexander Steffens (heftig) 2019-06-19 14:08:06 +02:00
parent 9528bfd78f
commit daafce54ac
No known key found for this signature in database
GPG key ID: DE5E0C5F25941CA5

View file

@ -480,7 +480,6 @@ GST_START_TEST (test_video_caps_late)
GstHarness *v_sink = GstHarness *v_sink =
gst_harness_new_with_element (demux->element, NULL, NULL); gst_harness_new_with_element (demux->element, NULL, NULL);
DemuxHarnesses harnesses = { a_sink, v_sink }; DemuxHarnesses harnesses = { a_sink, v_sink };
guint i;
GstTestClock *tclock; GstTestClock *tclock;
g_object_set (mux->element, "streamable", TRUE, g_object_set (mux->element, "streamable", TRUE,
@ -532,8 +531,7 @@ GST_START_TEST (test_video_caps_late)
/* push from flvmux to demux */ /* push from flvmux to demux */
for (i = 0; i < 6; i++) fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 6));
gst_harness_push_to_sink (mux);
/* verify we got 2x audio and 1x video buffers out of flvdemux */ /* verify we got 2x audio and 1x video buffers out of flvdemux */
gst_buffer_unref (gst_harness_pull (a_sink)); gst_buffer_unref (gst_harness_pull (a_sink));
@ -572,7 +570,6 @@ GST_START_TEST (test_video_caps_change_streamable)
GstHarness *v_sink = GstHarness *v_sink =
gst_harness_new_with_element (demux->element, NULL, NULL); gst_harness_new_with_element (demux->element, NULL, NULL);
DemuxHarnesses harnesses = { a_sink, v_sink }; DemuxHarnesses harnesses = { a_sink, v_sink };
guint i;
const GstClockTime base_time = 123456789; const GstClockTime base_time = 123456789;
const GstClockTime duration_ms = 20; const GstClockTime duration_ms = 20;
@ -605,9 +602,7 @@ GST_START_TEST (test_video_caps_change_streamable)
gst_harness_crank_single_clock_wait (mux); gst_harness_crank_single_clock_wait (mux);
/* push from flvmux to demux */ /* push from flvmux to demux */
for (i = 0; i < 6; i++) { fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 6));
gst_harness_push_to_sink (mux);
}
/* should accept without the constraint */ /* should accept without the constraint */
while ((event = gst_harness_try_pull_event (v_sink))) { while ((event = gst_harness_try_pull_event (v_sink))) {
@ -633,9 +628,7 @@ GST_START_TEST (test_video_caps_change_streamable)
gst_harness_crank_single_clock_wait (mux); gst_harness_crank_single_clock_wait (mux);
/* push from flvmux to demux */ /* push from flvmux to demux */
for (i = 0; i < 2; i++) { fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 2));
gst_harness_push_to_sink (mux);
}
/* should accept without the constraint */ /* should accept without the constraint */
while ((event = gst_harness_try_pull_event (v_sink))) { while ((event = gst_harness_try_pull_event (v_sink))) {
@ -680,7 +673,6 @@ GST_START_TEST (test_audio_caps_change_streamable)
GstHarness *v_sink = GstHarness *v_sink =
gst_harness_new_with_element (demux->element, NULL, NULL); gst_harness_new_with_element (demux->element, NULL, NULL);
DemuxHarnesses harnesses = { a_sink, v_sink }; DemuxHarnesses harnesses = { a_sink, v_sink };
guint i;
const GstClockTime base_time = 123456789; const GstClockTime base_time = 123456789;
const GstClockTime duration_ms = 20; const GstClockTime duration_ms = 20;
@ -713,9 +705,7 @@ GST_START_TEST (test_audio_caps_change_streamable)
gst_harness_crank_single_clock_wait (mux); gst_harness_crank_single_clock_wait (mux);
/* push from flvmux to demux */ /* push from flvmux to demux */
for (i = 0; i < 6; i++) { fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 6));
gst_harness_push_to_sink (mux);
}
/* should accept without the constraint */ /* should accept without the constraint */
while ((event = gst_harness_try_pull_event (a_sink))) { while ((event = gst_harness_try_pull_event (a_sink))) {
@ -743,9 +733,7 @@ GST_START_TEST (test_audio_caps_change_streamable)
gst_harness_crank_single_clock_wait (mux); gst_harness_crank_single_clock_wait (mux);
/* push from flvmux to demux */ /* push from flvmux to demux */
for (i = 0; i < 2; i++) { fail_unless_equals_int (GST_FLOW_OK, gst_harness_sink_push_many (mux, 2));
gst_harness_push_to_sink (mux);
}
/* should accept without the constraint */ /* should accept without the constraint */
while ((event = gst_harness_try_pull_event (a_sink))) { while ((event = gst_harness_try_pull_event (a_sink))) {