1 #include <memory> 2 #include "test/jemalloc_test.h" 3 TEST_BEGIN(test_basic)4TEST_BEGIN(test_basic) { 5 auto foo = new long(4); 6 assert_ptr_not_null(foo, "Unexpected new[] failure"); 7 delete foo; 8 // Test nullptr handling. 9 foo = nullptr; 10 delete foo; 11 12 auto bar = new long; 13 assert_ptr_not_null(bar, "Unexpected new failure"); 14 delete bar; 15 // Test nullptr handling. 16 bar = nullptr; 17 delete bar; 18 } 19 TEST_END 20 21 int main()22main() { 23 return test( 24 test_basic); 25 } 26