basic.cpp revision 1.1.1.1
1#include <memory> 2#include "test/jemalloc_test.h" 3 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} 19TEST_END 20 21int 22main() { 23 return test( 24 test_basic); 25} 26