mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 21:35:44 +00:00
tests: gstbuffer: extend buffer copy test
This commit is contained in:
parent
b5caa93f6d
commit
8620352efc
1 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue