From: Mark Nauwelaerts Date: Thu, 19 Jul 2012 11:51:23 +0000 (+0200) Subject: tests: gstbuffer: add tests for some mulitple map combinations X-Git-Tag: RELEASE-0.11.93~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9166014007964199582a7670f7b4950ee45e779e;p=platform%2Fupstream%2Fgstreamer.git tests: gstbuffer: add tests for some mulitple map combinations --- diff --git a/tests/check/gst/gstbuffer.c b/tests/check/gst/gstbuffer.c index f667f1a..b2ebdd1 100644 --- a/tests/check/gst/gstbuffer.c +++ b/tests/check/gst/gstbuffer.c @@ -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); }