Debian Codegraph @

tests/test-memory.cc

raw symbols SCIP
1 /*
2 * test-message.cc
3 *
4 * Created on: Feb 28, 2015
5 * Author: m.kolny
6 */
7 #include "mmtest.h"
8 #include <gstreamermm.h>
9
10 using namespace Gst;
11
12 TEST(MemoryTest, CheckMemoryMappedRefcount)
13 {
14 guint* data = new guint[10];
15 Glib::RefPtr<Memory> mem = Memory::create(MEMORY_FLAG_READONLY, data, 10, 0, 10);
16 MapInfo info;
17 Glib::RefPtr<Memory> mp = mem->make_mapped(info, MAP_READ);
18 mp->unmap(info);
19 ASSERT_EQ(2, mem->get_refcount());
20 ASSERT_EQ(2, mp->get_refcount());
21 delete [] data;
22 }