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