tests: bufferpool: fix wrong assumptions about pointers and object lifecycles
authorTim-Philipp Müller <tim@centricular.com>
Sun, 10 Apr 2016 19:04:07 +0000 (20:04 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 10 Apr 2016 19:11:00 +0000 (20:11 +0100)
commit4b9f2966fbf8e374725e67276d33cda752ce4439
tree220b765f2672dcd455d656260908283857f51ec2
parentfbcfa382361a7ffda6f737277f0ed9ae85f44f03
tests: bufferpool: fix wrong assumptions about pointers and object lifecycles

The test assumed that if a buffer has the same pointer address as
before it is in fact the same mini object and has been re-used by
the pool. This seems to be mostly true, but not always. The buffer
might be destroyed and when a new buffer is created the allocator
might return the same memory that we just freed.

Instead attach a qdata with destroy notify function to buffer
instances we want to track to make sure the buffer actually
gets finalized rather than resurrected and put back into the pool.
tests/check/gst/gstbufferpool.c