testmem: check allocation success