mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
tests: fix more unit tests
This commit is contained in:
parent
a9b2e095ff
commit
6cb590ba16
2 changed files with 23 additions and 16 deletions
|
@ -505,6 +505,7 @@ GST_START_TEST (test_crc)
|
||||||
|
|
||||||
/* verify the header checksum */
|
/* verify the header checksum */
|
||||||
/* CRC's start at 58 in the header */
|
/* CRC's start at 58 in the header */
|
||||||
|
outbuffer = gst_buffer_make_writable (outbuffer);
|
||||||
data = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READWRITE);
|
data = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READWRITE);
|
||||||
crc_calculated = gst_dp_crc (data, 58);
|
crc_calculated = gst_dp_crc (data, 58);
|
||||||
crc_read = GST_READ_UINT16_BE (data + 58);
|
crc_read = GST_READ_UINT16_BE (data + 58);
|
||||||
|
|
|
@ -223,6 +223,8 @@ test_srt_do_test (SubParseInputChunk * input, guint start_idx, guint num)
|
||||||
input[n].to_ts - input[n].from_ts);
|
input[n].to_ts - input[n].from_ts);
|
||||||
|
|
||||||
out = gst_buffer_map (buf, &out_size, NULL, GST_MAP_READ);
|
out = gst_buffer_map (buf, &out_size, NULL, GST_MAP_READ);
|
||||||
|
/* can be NULL */
|
||||||
|
if (out != NULL) {
|
||||||
/* shouldn't have trailing newline characters */
|
/* shouldn't have trailing newline characters */
|
||||||
fail_if (out_size > 0 && out[out_size - 1] == '\n');
|
fail_if (out_size > 0 && out[out_size - 1] == '\n');
|
||||||
/* shouldn't include NUL-terminator in data size */
|
/* shouldn't include NUL-terminator in data size */
|
||||||
|
@ -231,6 +233,7 @@ test_srt_do_test (SubParseInputChunk * input, guint start_idx, guint num)
|
||||||
fail_unless_equals_int (out[out_size], '\0');
|
fail_unless_equals_int (out[out_size], '\0');
|
||||||
/* make sure out string matches expected string */
|
/* make sure out string matches expected string */
|
||||||
fail_unless_equals_string (out, input[n].out);
|
fail_unless_equals_string (out, input[n].out);
|
||||||
|
}
|
||||||
gst_buffer_unmap (buf, out, out_size);
|
gst_buffer_unmap (buf, out, out_size);
|
||||||
/* check caps */
|
/* check caps */
|
||||||
fail_unless (GST_BUFFER_CAPS (buf) != NULL);
|
fail_unless (GST_BUFFER_CAPS (buf) != NULL);
|
||||||
|
@ -310,6 +313,8 @@ do_test (SubParseInputChunk * input, guint num, const gchar * media_type)
|
||||||
}
|
}
|
||||||
|
|
||||||
out = gst_buffer_map (buf, &out_size, NULL, GST_MAP_READ);
|
out = gst_buffer_map (buf, &out_size, NULL, GST_MAP_READ);
|
||||||
|
/* can be NULL */
|
||||||
|
if (out != NULL) {
|
||||||
/* shouldn't have trailing newline characters */
|
/* shouldn't have trailing newline characters */
|
||||||
fail_if (out_size > 0 && out[out_size - 1] == '\n');
|
fail_if (out_size > 0 && out[out_size - 1] == '\n');
|
||||||
/* shouldn't include NUL-terminator in data size */
|
/* shouldn't include NUL-terminator in data size */
|
||||||
|
@ -318,6 +323,7 @@ do_test (SubParseInputChunk * input, guint num, const gchar * media_type)
|
||||||
fail_unless_equals_int (out[out_size], '\0');
|
fail_unless_equals_int (out[out_size], '\0');
|
||||||
/* make sure out string matches expected string */
|
/* make sure out string matches expected string */
|
||||||
fail_unless_equals_string (out, input[n].out);
|
fail_unless_equals_string (out, input[n].out);
|
||||||
|
}
|
||||||
gst_buffer_unmap (buf, out, out_size);
|
gst_buffer_unmap (buf, out, out_size);
|
||||||
/* check caps */
|
/* check caps */
|
||||||
fail_unless (GST_BUFFER_CAPS (buf) != NULL);
|
fail_unless (GST_BUFFER_CAPS (buf) != NULL);
|
||||||
|
|
Loading…
Reference in a new issue