tests: fix indentation

This commit is contained in:
Tim-Philipp Müller 2016-02-19 14:41:07 +00:00
parent 69436d5a61
commit 7335d03070
4 changed files with 114 additions and 109 deletions

View file

@ -171,7 +171,7 @@ GST_END_TEST;
static GstBuffer * static GstBuffer *
create_buffer (guint8 * data, gsize size) create_buffer (guint8 * data, gsize size)
{ {
GstBuffer * buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, GstBuffer *buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
data, size, 0, size, NULL, NULL); data, size, 0, size, NULL, NULL);
GST_BUFFER_PTS (buf) = GST_CLOCK_TIME_NONE; GST_BUFFER_PTS (buf) = GST_CLOCK_TIME_NONE;
GST_BUFFER_DTS (buf) = GST_CLOCK_TIME_NONE; GST_BUFFER_DTS (buf) = GST_CLOCK_TIME_NONE;
@ -184,7 +184,7 @@ create_buffer (guint8 * data, gsize size)
static void static void
flvdemux_pad_added (GstElement * flvdemux, GstPad * srcpad, GstHarness * h) flvdemux_pad_added (GstElement * flvdemux, GstPad * srcpad, GstHarness * h)
{ {
(void)flvdemux; (void) flvdemux;
gst_harness_add_element_src_pad (h, srcpad); gst_harness_add_element_src_pad (h, srcpad);
} }
@ -255,7 +255,7 @@ GST_START_TEST (test_speex)
0xba, 0xb7, 0x00, 0x00, 0x00, 0x52, 0xba, 0xb7, 0x00, 0x00, 0x00, 0x52,
}; };
GstHarness * h = gst_harness_new_with_padnames ("flvdemux", "sink", NULL); GstHarness *h = gst_harness_new_with_padnames ("flvdemux", "sink", NULL);
gst_harness_set_src_caps_str (h, "video/x-flv"); gst_harness_set_src_caps_str (h, "video/x-flv");
g_signal_connect (h->element, "pad-added", g_signal_connect (h->element, "pad-added",
@ -268,8 +268,8 @@ GST_START_TEST (test_speex)
gst_harness_push (h, create_buffer (buffer, sizeof (buffer))); gst_harness_push (h, create_buffer (buffer, sizeof (buffer)));
{ {
GstCaps * caps; GstCaps *caps;
const GstStructure * s; const GstStructure *s;
const GValue *streamheader; const GValue *streamheader;
const GValue *header; const GValue *header;
const GValue *vorbiscomment; const GValue *vorbiscomment;

View file

@ -157,7 +157,7 @@ static GstBuffer *
create_buffer (guint8 * data, gsize size, create_buffer (guint8 * data, gsize size,
GstClockTime timestamp, GstClockTime duration) GstClockTime timestamp, GstClockTime duration)
{ {
GstBuffer * buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, GstBuffer *buf = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
data, size, 0, size, NULL, NULL); data, size, 0, size, NULL, NULL);
GST_BUFFER_PTS (buf) = timestamp; GST_BUFFER_PTS (buf) = timestamp;
GST_BUFFER_DTS (buf) = timestamp; GST_BUFFER_DTS (buf) = timestamp;
@ -169,7 +169,7 @@ create_buffer (guint8 * data, gsize size,
GST_START_TEST (test_speex_streamable) GST_START_TEST (test_speex_streamable)
{ {
GstBuffer * buf; GstBuffer *buf;
GstMapInfo map = GST_MAP_INFO_INIT; GstMapInfo map = GST_MAP_INFO_INIT;
guint8 header0[] = { guint8 header0[] = {
@ -205,7 +205,7 @@ GST_START_TEST (test_speex_streamable)
0x0a, 0xba, 0xba, 0xba, 0xba, 0xb7 0x0a, 0xba, 0xba, 0xba, 0xba, 0xb7
}; };
GstCaps * caps = gst_caps_new_simple ("audio/x-speex", GstCaps *caps = gst_caps_new_simple ("audio/x-speex",
"rate", G_TYPE_INT, 16000, "rate", G_TYPE_INT, 16000,
"channels", G_TYPE_INT, 1, "channels", G_TYPE_INT, 1,
NULL); NULL);
@ -214,7 +214,7 @@ GST_START_TEST (test_speex_streamable)
const GstClockTime duration_ms = 20; const GstClockTime duration_ms = 20;
const GstClockTime duration = duration_ms * GST_MSECOND; const GstClockTime duration = duration_ms * GST_MSECOND;
GstHarness * h = gst_harness_new_with_padnames ("flvmux", "audio", "src"); GstHarness *h = gst_harness_new_with_padnames ("flvmux", "audio", "src");
gst_harness_set_src_caps (h, caps); gst_harness_set_src_caps (h, caps);
g_object_set (h->element, "streamable", 1, NULL); g_object_set (h->element, "streamable", 1, NULL);
@ -228,7 +228,7 @@ GST_START_TEST (test_speex_streamable)
gst_harness_push (h, create_buffer (buffer, sizeof (buffer), gst_harness_push (h, create_buffer (buffer, sizeof (buffer),
base_time, duration)); base_time, duration));
/* push speex data 2*/ /* push speex data 2 */
gst_harness_push (h, create_buffer (buffer, sizeof (buffer), gst_harness_push (h, create_buffer (buffer, sizeof (buffer),
base_time + duration, duration)); base_time + duration, duration));
@ -240,8 +240,8 @@ GST_START_TEST (test_speex_streamable)
/* pull out segment event and verify we are using GST_FORMAT_TIME */ /* pull out segment event and verify we are using GST_FORMAT_TIME */
{ {
GstEvent * event = gst_harness_pull_event (h); GstEvent *event = gst_harness_pull_event (h);
const GstSegment * segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
fail_unless_equals_int (GST_FORMAT_TIME, segment->format); fail_unless_equals_int (GST_FORMAT_TIME, segment->format);
gst_event_unref (event); gst_event_unref (event);
@ -294,7 +294,8 @@ GST_START_TEST (test_speex_streamable)
fail_unless_equals_uint64 (base_time, GST_BUFFER_DTS (buf)); fail_unless_equals_uint64 (base_time, GST_BUFFER_DTS (buf));
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf)); fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf)); fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET_END (buf)); fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,
GST_BUFFER_OFFSET_END (buf));
gst_buffer_map (buf, &map, GST_MAP_READ); gst_buffer_map (buf, &map, GST_MAP_READ);
/* 0x08 means it is audio */ /* 0x08 means it is audio */
fail_unless_equals_int (0x08, map.data[0]); fail_unless_equals_int (0x08, map.data[0]);
@ -313,7 +314,8 @@ GST_START_TEST (test_speex_streamable)
fail_unless_equals_uint64 (base_time + duration, GST_BUFFER_DTS (buf)); fail_unless_equals_uint64 (base_time + duration, GST_BUFFER_DTS (buf));
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf)); fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf)); fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET_END (buf)); fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,
GST_BUFFER_OFFSET_END (buf));
gst_buffer_map (buf, &map, GST_MAP_READ); gst_buffer_map (buf, &map, GST_MAP_READ);
/* 0x08 means it is audio */ /* 0x08 means it is audio */
fail_unless_equals_int (0x08, map.data[0]); fail_unless_equals_int (0x08, map.data[0]);
@ -328,6 +330,7 @@ GST_START_TEST (test_speex_streamable)
gst_harness_teardown (h); gst_harness_teardown (h);
} }
GST_END_TEST; GST_END_TEST;
static Suite * static Suite *

View file

@ -59,6 +59,7 @@ GST_START_TEST (test_h263depay_start_packet_too_small_mode_a)
gst_harness_teardown (h); gst_harness_teardown (h);
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_h263depay_start_packet_too_small_mode_b) GST_START_TEST (test_h263depay_start_packet_too_small_mode_b)
@ -78,6 +79,7 @@ GST_START_TEST (test_h263depay_start_packet_too_small_mode_b)
gst_harness_teardown (h); gst_harness_teardown (h);
} }
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_h263depay_start_packet_too_small_mode_c) GST_START_TEST (test_h263depay_start_packet_too_small_mode_c)
@ -97,6 +99,7 @@ GST_START_TEST (test_h263depay_start_packet_too_small_mode_c)
gst_harness_teardown (h); gst_harness_teardown (h);
} }
GST_END_TEST; GST_END_TEST;
static Suite * static Suite *

View file

@ -649,9 +649,8 @@ GST_START_TEST (test_two_lost_one_arrives_in_time)
/* the first lost buffer (buffer 3) out on /* the first lost buffer (buffer 3) out on
* (buffer-timestamp (60) + latency (100) = 160) */ * (buffer-timestamp (60) + latency (100) = 160) */
gst_test_clock_wait_for_next_pending_id (testclock, &id); gst_test_clock_wait_for_next_pending_id (testclock, &id);
fail_unless_equals_uint64 ( fail_unless_equals_uint64 (3 * PCMU_BUF_DURATION +
3 * PCMU_BUF_DURATION + jb_latency_ms * GST_MSECOND, jb_latency_ms * GST_MSECOND, gst_clock_id_get_time (id));
gst_clock_id_get_time (id));
gst_clock_id_unref (id); gst_clock_id_unref (id);
/* let the time expire... */ /* let the time expire... */
@ -1057,8 +1056,8 @@ GST_START_TEST (test_rtx_packet_delay)
* are exceeding the max allowed reorder distance and should request a * are exceeding the max allowed reorder distance and should request a
* retransmission right away */ * retransmission right away */
fail_unless_equals_int (GST_FLOW_OK, fail_unless_equals_int (GST_FLOW_OK,
gst_harness_push (h, generate_test_buffer_full ( gst_harness_push (h, generate_test_buffer_full (20 * GST_MSECOND, TRUE, 8,
20 * GST_MSECOND, TRUE, 8, 8 * PCMU_RTP_TS_DURATION))); 8 * PCMU_RTP_TS_DURATION)));
/* drop reconfigure event */ /* drop reconfigure event */
gst_event_unref (gst_harness_pull_upstream_event (h)); gst_event_unref (gst_harness_pull_upstream_event (h));
@ -1079,8 +1078,8 @@ GST_START_TEST (test_rtx_packet_delay)
/* push 9, this should immediately request retransmission of 5 */ /* push 9, this should immediately request retransmission of 5 */
fail_unless_equals_int (GST_FLOW_OK, fail_unless_equals_int (GST_FLOW_OK,
gst_harness_push (h, generate_test_buffer_full ( gst_harness_push (h, generate_test_buffer_full (20 * GST_MSECOND, TRUE, 9,
20 * GST_MSECOND, TRUE, 9, 9 * PCMU_RTP_TS_DURATION))); 9 * PCMU_RTP_TS_DURATION)));
/* we should now receive retransmission requests for 5 */ /* we should now receive retransmission requests for 5 */
out_event = gst_harness_pull_upstream_event (h); out_event = gst_harness_pull_upstream_event (h);
@ -1242,7 +1241,7 @@ GST_START_TEST (test_gap_exceeds_latency)
/* 8 */ /* 8 */
for (i = 8; i <= 16; i++) { for (i = 8; i <= 16; i++) {
GstBuffer * out_buf = gst_harness_pull (h); GstBuffer *out_buf = gst_harness_pull (h);
GST_DEBUG ("pop %d", i); GST_DEBUG ("pop %d", i);
fail_unless_equals_int (i, get_rtp_seq_num (out_buf)); fail_unless_equals_int (i, get_rtp_seq_num (out_buf));
gst_buffer_unref (out_buf); gst_buffer_unref (out_buf);
@ -1364,7 +1363,7 @@ GST_END_TEST;
GST_START_TEST (test_push_big_gap) GST_START_TEST (test_push_big_gap)
{ {
GstHarness *h = gst_harness_new ("rtpjitterbuffer"); GstHarness *h = gst_harness_new ("rtpjitterbuffer");
GstBuffer * buf; GstBuffer *buf;
const gint num_consecutive = 5; const gint num_consecutive = 5;
gint i; gint i;
@ -1377,7 +1376,7 @@ GST_START_TEST (test_push_big_gap)
fail_unless (gst_harness_crank_single_clock_wait (h)); fail_unless (gst_harness_crank_single_clock_wait (h));
for (i = 0; i < num_consecutive; i++) { for (i = 0; i < num_consecutive; i++) {
GstBuffer * buf = gst_harness_pull (h); GstBuffer *buf = gst_harness_pull (h);
fail_unless_equals_int (1000 + i, get_rtp_seq_num (buf)); fail_unless_equals_int (1000 + i, get_rtp_seq_num (buf));
gst_buffer_unref (buf); gst_buffer_unref (buf);
} }
@ -1391,7 +1390,7 @@ GST_START_TEST (test_push_big_gap)
fail_unless (gst_harness_crank_single_clock_wait (h)); fail_unless (gst_harness_crank_single_clock_wait (h));
for (i = 0; i < num_consecutive; i++) { for (i = 0; i < num_consecutive; i++) {
GstBuffer * buf = gst_harness_pull (h); GstBuffer *buf = gst_harness_pull (h);
fail_unless_equals_int (20000 + i, get_rtp_seq_num (buf)); fail_unless_equals_int (20000 + i, get_rtp_seq_num (buf));
gst_buffer_unref (buf); gst_buffer_unref (buf);
} }