| 1 | #include "mmtest.h" |
| 2 | #include <gstreamermm.h> |
| 3 | |
| 4 | using namespace Gst; |
| 5 | using Glib::RefPtr; |
| 6 | |
| 7 | TEST(SampleTest, CheckGetCapsMethod) |
| 8 | { |
| 9 | auto caps = Caps::create_any(); |
| 10 | ASSERT_EQ(1, caps->get_refcount()); |
| 11 | |
| 12 | auto sample = Sample::create(RefPtr<Buffer>(), caps, Segment(), Structure()); |
| 13 | ASSERT_EQ(2, caps->get_refcount()); |
| 14 | |
| 15 | { |
| 16 | auto tmp_caps = sample->get_caps(); |
| 17 | ASSERT_EQ(3, caps->get_refcount()); |
| 18 | MM_ASSERT_TRUE(tmp_caps->equals(caps)); |
| 19 | } |
| 20 | |
| 21 | ASSERT_EQ(2, caps->get_refcount()); |
| 22 | |
| 23 | } |