Added test for successful allocation of memory