Commit 91660140 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

tests: gstbuffer: add tests for some mulitple map combinations

parent 29976a00
......@@ -603,7 +603,7 @@ GST_END_TEST;
GST_START_TEST (test_map)
{
GstBuffer *buf;
GstMapInfo map;
GstMapInfo map, map2;
gsize maxalloc;
gsize size, offset;
......@@ -640,6 +640,20 @@ GST_START_TEST (test_map)
gst_buffer_map (buf, &map, GST_MAP_WRITE);
gst_buffer_unmap (buf, &map);
/* mapping same kind should be ok using same memory */
gst_buffer_map (buf, &map, GST_MAP_WRITE);
fail_unless (gst_buffer_map (buf, &map2, GST_MAP_WRITE));
fail_unless (map.memory == map2.memory);
gst_buffer_unmap (buf, &map2);
gst_buffer_unmap (buf, &map);
/* ... but different kind should give temporary memory */
gst_buffer_map (buf, &map, GST_MAP_WRITE);
fail_unless (gst_buffer_map (buf, &map2, GST_MAP_READ));
fail_if (map.memory == map2.memory);
gst_buffer_unmap (buf, &map2);
gst_buffer_unmap (buf, &map);
gst_buffer_unref (buf);
}
......
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