Add extra assert() in tests allocating memory on the heap.