summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2010-01-22 11:38:59 -0300
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2010-02-12 17:23:29 -0300
commitaad80a10530fdd0ee8a943c1ea34bbf821db5bb5 (patch)
treeba648b18d427c49da1f8f7d012d61830bcd16b76
parentbfff7a1b4ece0c0b5ca30dd93392707fc097f7a9 (diff)
bytewriter: Adds a test for _fill
-rw-r--r--tests/check/libs/bytewriter.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/check/libs/bytewriter.c b/tests/check/libs/bytewriter.c
index 6cb06d2454..fab4a5e7e8 100644
--- a/tests/check/libs/bytewriter.c
+++ b/tests/check/libs/bytewriter.c
@@ -219,6 +219,23 @@ GST_START_TEST (test_put_data_strings)
GST_END_TEST;
+GST_START_TEST (test_fill)
+{
+ GstByteWriter writer;
+ guint8 data[] = { 0x0, 0x0, 0x0, 0x0, 0x5, 0x5 };
+ guint8 *data2;
+
+ gst_byte_writer_init (&writer);
+ fail_unless (gst_byte_writer_fill (&writer, 0, 4));
+ fail_unless (gst_byte_writer_fill (&writer, 5, 2));
+
+ data2 = gst_byte_writer_reset_and_get_data (&writer);
+ fail_unless (data2 != NULL);
+ fail_unless (memcmp (data2, data, 6) == 0);
+ g_free (data2);
+}
+
+GST_END_TEST;
static Suite *
gst_byte_writer_suite (void)
{
@@ -232,6 +249,7 @@ gst_byte_writer_suite (void)
tcase_add_test (tc_chain, test_write_non_fixed);
tcase_add_test (tc_chain, test_from_data);
tcase_add_test (tc_chain, test_put_data_strings);
+ tcase_add_test (tc_chain, test_fill);
return s;
}