tests: fix indentation of various unit tests

This commit is contained in:
Tim-Philipp Müller 2016-01-06 01:06:10 +00:00
parent 63d7a2a89a
commit e5fb7275c2
4 changed files with 65 additions and 75 deletions

View file

@ -202,8 +202,8 @@ static GstHarness *
setup_audiodecodertester (GstStaticPadTemplate * sinktemplate, setup_audiodecodertester (GstStaticPadTemplate * sinktemplate,
GstStaticPadTemplate * srctemplate) GstStaticPadTemplate * srctemplate)
{ {
GstHarness * h; GstHarness *h;
GstElement * dec; GstElement *dec;
if (sinktemplate == NULL) if (sinktemplate == NULL)
sinktemplate = &sinktemplate_default; sinktemplate = &sinktemplate_default;
@ -215,9 +215,7 @@ setup_audiodecodertester (GstStaticPadTemplate * sinktemplate,
gst_harness_set_src_caps (h, gst_harness_set_src_caps (h,
gst_caps_new_simple ("audio/x-test-custom", gst_caps_new_simple ("audio/x-test-custom",
"channels", G_TYPE_INT, 2, "channels", G_TYPE_INT, 2, "rate", G_TYPE_INT, 44100, NULL));
"rate", G_TYPE_INT, 44100,
NULL));
gst_object_unref (dec); gst_object_unref (dec);
return h; return h;
@ -337,8 +335,7 @@ GST_START_TEST (audiodecoder_negotiation_with_gap_event)
GstHarness *h = setup_audiodecodertester (NULL, NULL); GstHarness *h = setup_audiodecodertester (NULL, NULL);
/* push a gap event to force audiodecoder to push a caps event */ /* push a gap event to force audiodecoder to push a caps event */
fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, GST_SECOND)));
GST_SECOND)));
fail_unless_equals_int (0, gst_harness_buffers_in_queue (h)); fail_unless_equals_int (0, gst_harness_buffers_in_queue (h));
check_audiodecoder_negotiation (h); check_audiodecoder_negotiation (h);
@ -355,8 +352,7 @@ GST_START_TEST (audiodecoder_delayed_negotiation_with_gap_event)
((GstAudioDecoderTester *) h->element)->setoutputformat_on_decoding = TRUE; ((GstAudioDecoderTester *) h->element)->setoutputformat_on_decoding = TRUE;
/* push a gap event to force audiodecoder to push a caps event */ /* push a gap event to force audiodecoder to push a caps event */
fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, GST_SECOND)));
GST_SECOND)));
fail_unless_equals_int (0, gst_harness_buffers_in_queue (h)); fail_unless_equals_int (0, gst_harness_buffers_in_queue (h));
check_audiodecoder_negotiation (h); check_audiodecoder_negotiation (h);
@ -372,8 +368,7 @@ GST_START_TEST (audiodecoder_first_data_is_gap)
GstHarness *h = setup_audiodecodertester (NULL, NULL); GstHarness *h = setup_audiodecodertester (NULL, NULL);
/* push a gap */ /* push a gap */
fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, fail_unless (gst_harness_push_event (h, gst_event_new_gap (0, GST_SECOND)));
GST_SECOND)));
/* make sure the usual events have been received */ /* make sure the usual events have been received */
{ {
@ -426,7 +421,8 @@ _audiodecoder_flush_events (gboolean send_buffers)
tags = gst_tag_list_new (GST_TAG_TRACK_NUMBER, i, NULL); tags = gst_tag_list_new (GST_TAG_TRACK_NUMBER, i, NULL);
fail_unless (gst_harness_push_event (h, gst_event_new_tag (tags))); fail_unless (gst_harness_push_event (h, gst_event_new_tag (tags)));
} else { } else {
fail_unless (gst_harness_push (h, create_test_buffer (i)) == GST_FLOW_OK); fail_unless (gst_harness_push (h,
create_test_buffer (i)) == GST_FLOW_OK);
} }
} }
} else { } else {

View file

@ -138,8 +138,8 @@ gst_audio_encoder_tester_init (GstAudioEncoderTester * tester)
static GstHarness * static GstHarness *
setup_audioencodertester (void) setup_audioencodertester (void)
{ {
GstHarness * h; GstHarness *h;
GstElement * enc; GstElement *enc;
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK, GST_PAD_SINK,
@ -160,8 +160,7 @@ setup_audioencodertester (void)
"rate", G_TYPE_INT, TEST_AUDIO_RATE, "rate", G_TYPE_INT, TEST_AUDIO_RATE,
"channels", G_TYPE_INT, TEST_AUDIO_CHANNELS, "channels", G_TYPE_INT, TEST_AUDIO_CHANNELS,
"format", G_TYPE_STRING, TEST_AUDIO_FORMAT, "format", G_TYPE_STRING, TEST_AUDIO_FORMAT,
"layout", G_TYPE_STRING, "interleaved", "layout", G_TYPE_STRING, "interleaved", NULL));
NULL));
gst_object_unref (enc); gst_object_unref (enc);
return h; return h;
@ -196,7 +195,7 @@ GST_START_TEST (audioencoder_playback)
guint64 i; guint64 i;
guint buffers_available; guint buffers_available;
GstHarness * h = setup_audioencodertester (); GstHarness *h = setup_audioencodertester ();
/* push buffers, the data is actually a number so we can track them */ /* push buffers, the data is actually a number so we can track them */
for (i = 0; i < NUM_BUFFERS; i++) { for (i = 0; i < NUM_BUFFERS; i++) {

View file

@ -855,6 +855,7 @@ GST_START_TEST (test_rtcp_validate_with_padding)
fail_unless (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt))); fail_unless (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_rtcp_validate_with_padding_wrong_padlength) GST_START_TEST (test_rtcp_validate_with_padding_wrong_padlength)
@ -885,6 +886,7 @@ GST_START_TEST (test_rtcp_validate_with_padding_wrong_padlength)
fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt))); fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_rtcp_validate_with_padding_excluded_from_length) GST_START_TEST (test_rtcp_validate_with_padding_excluded_from_length)
@ -915,6 +917,7 @@ GST_START_TEST (test_rtcp_validate_with_padding_excluded_from_length)
fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt))); fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_rtcp_validate_with_padding_set_in_first_packet) GST_START_TEST (test_rtcp_validate_with_padding_set_in_first_packet)
@ -945,6 +948,7 @@ GST_START_TEST (test_rtcp_validate_with_padding_set_in_first_packet)
fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt))); fail_if (gst_rtcp_buffer_validate_data (rtcp_pkt, sizeof (rtcp_pkt)));
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_rtcp_validate_reduced_without_padding) GST_START_TEST (test_rtcp_validate_reduced_without_padding)
@ -961,8 +965,10 @@ GST_START_TEST (test_rtcp_validate_reduced_without_padding)
0xbb, 0xce, 0x9e, 0x3e, 0xbb, 0xce, 0x9e, 0x3e,
}; };
fail_unless (gst_rtcp_buffer_validate_data_reduced (rtcp_pkt, sizeof (rtcp_pkt))); fail_unless (gst_rtcp_buffer_validate_data_reduced (rtcp_pkt,
sizeof (rtcp_pkt)));
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_rtcp_validate_reduced_with_padding) GST_START_TEST (test_rtcp_validate_reduced_with_padding)
@ -982,6 +988,7 @@ GST_START_TEST (test_rtcp_validate_reduced_with_padding)
fail_if (gst_rtcp_buffer_validate_data_reduced (rtcp_pkt, sizeof (rtcp_pkt))); fail_if (gst_rtcp_buffer_validate_data_reduced (rtcp_pkt, sizeof (rtcp_pkt)));
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_rtp_ntp64_extension) GST_START_TEST (test_rtp_ntp64_extension)
@ -1218,8 +1225,10 @@ rtp_suite (void)
tcase_add_test (tc_chain, test_rtcp_reduced_buffer); tcase_add_test (tc_chain, test_rtcp_reduced_buffer);
tcase_add_test (tc_chain, test_rtcp_validate_with_padding); tcase_add_test (tc_chain, test_rtcp_validate_with_padding);
tcase_add_test (tc_chain, test_rtcp_validate_with_padding_wrong_padlength); tcase_add_test (tc_chain, test_rtcp_validate_with_padding_wrong_padlength);
tcase_add_test (tc_chain, test_rtcp_validate_with_padding_excluded_from_length); tcase_add_test (tc_chain,
tcase_add_test (tc_chain, test_rtcp_validate_with_padding_set_in_first_packet); test_rtcp_validate_with_padding_excluded_from_length);
tcase_add_test (tc_chain,
test_rtcp_validate_with_padding_set_in_first_packet);
tcase_add_test (tc_chain, test_rtcp_validate_reduced_without_padding); tcase_add_test (tc_chain, test_rtcp_validate_reduced_without_padding);
tcase_add_test (tc_chain, test_rtcp_validate_reduced_with_padding); tcase_add_test (tc_chain, test_rtcp_validate_reduced_with_padding);
tcase_add_test (tc_chain, test_rtp_ntp64_extension); tcase_add_test (tc_chain, test_rtp_ntp64_extension);

View file

@ -1783,30 +1783,23 @@ GST_START_TEST (rtp_base_payload_framerate_attribute)
State *state; State *state;
state = create_payloader ("video/x-raw,framerate=(fraction)1/4", &sinktmpl, state = create_payloader ("video/x-raw,framerate=(fraction)1/4", &sinktmpl,
"perfect-rtptime", FALSE, "perfect-rtptime", FALSE, NULL);
NULL);
set_state (state, GST_STATE_PLAYING); set_state (state, GST_STATE_PLAYING);
push_buffer (state, push_buffer (state, "pts", 0 * GST_SECOND, NULL);
"pts", 0 * GST_SECOND,
NULL);
set_state (state, GST_STATE_NULL); set_state (state, GST_STATE_NULL);
validate_buffers_received (1); validate_buffers_received (1);
validate_buffer (0, validate_buffer (0, "pts", 0 * GST_SECOND, NULL);
"pts", 0 * GST_SECOND,
NULL);
validate_events_received (3); validate_events_received (3);
validate_normal_start_events (0); validate_normal_start_events (0);
validate_event (1, "caps", validate_event (1, "caps", "a-framerate", "0.25", NULL);
"a-framerate", "0.25",
NULL);
destroy_payloader (state); destroy_payloader (state);
} }
@ -1823,33 +1816,26 @@ GST_START_TEST (rtp_base_payload_max_framerate_attribute)
{ {
State *state; State *state;
state = create_payloader ( state =
"video/x-raw,framerate=(fraction)0/1,max-framerate=(fraction)1/8", create_payloader
&sinktmpl, ("video/x-raw,framerate=(fraction)0/1,max-framerate=(fraction)1/8",
"perfect-rtptime", FALSE, &sinktmpl, "perfect-rtptime", FALSE, NULL);
NULL);
set_state (state, GST_STATE_PLAYING); set_state (state, GST_STATE_PLAYING);
push_buffer (state, push_buffer (state, "pts", 0 * GST_SECOND, NULL);
"pts", 0 * GST_SECOND,
NULL);
set_state (state, GST_STATE_NULL); set_state (state, GST_STATE_NULL);
validate_buffers_received (1); validate_buffers_received (1);
validate_buffer (0, validate_buffer (0, "pts", 0 * GST_SECOND, NULL);
"pts", 0 * GST_SECOND,
NULL);
validate_events_received (3); validate_events_received (3);
validate_normal_start_events (0); validate_normal_start_events (0);
validate_event (1, "caps", validate_event (1, "caps", "a-framerate", "0.125", NULL);
"a-framerate", "0.125",
NULL);
destroy_payloader (state); destroy_payloader (state);
} }