Commit 8620352e authored by Mark Nauwelaerts's avatar Mark Nauwelaerts Committed by Wim Taymans

tests: gstbuffer: extend buffer copy test

parent b5caa93f
......@@ -349,6 +349,21 @@ GST_START_TEST (test_copy)
gst_buffer_unref (copy);
gst_buffer_unref (buffer);
/* copy should still be independent if copied when mapped */
buffer = gst_buffer_new_and_alloc (4);
gst_buffer_memset (buffer, 0, 0, 4);
gst_buffer_map (buffer, &info, GST_MAP_WRITE);
copy = gst_buffer_copy (buffer);
fail_unless (gst_buffer_is_writable (copy));
gst_buffer_memset (copy, 0, 0x80, 4);
gst_buffer_unmap (buffer, &info);
gst_buffer_map (buffer, &info, GST_MAP_READ);
fail_if (gst_buffer_memcmp (copy, 0, info.data, info.size) == 0);
gst_buffer_unmap (buffer, &info);
gst_buffer_unref (copy);
gst_buffer_unref (buffer);
/* check if a writable clone of a buffer is independent when written to */
buffer = gst_buffer_new_and_alloc (4);
gst_buffer_memset (buffer, 0, 0, 4);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment