I have to test a library that provides its own memory allocation routine:
void* allocation_routine(size_t size) throw();
Documentation states that this function allocates at least size bytes of memory (it's allowed to allocate more). By the way the function uses posix_memalign internally, but the implementation may change.
I'm wondering if it's possible to write a unit test for that kind of functions? How can we test whether the required amount of memory was allocated?
UPDATE:
If we can't write a unit test then what is the closest solution?