diff options
Diffstat (limited to 'deps/jemalloc/test/integration/cpp/basic.cpp')
-rw-r--r-- | deps/jemalloc/test/integration/cpp/basic.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/deps/jemalloc/test/integration/cpp/basic.cpp b/deps/jemalloc/test/integration/cpp/basic.cpp new file mode 100644 index 0000000..65890ec --- /dev/null +++ b/deps/jemalloc/test/integration/cpp/basic.cpp @@ -0,0 +1,25 @@ +#include <memory> +#include "test/jemalloc_test.h" + +TEST_BEGIN(test_basic) { + auto foo = new long(4); + assert_ptr_not_null(foo, "Unexpected new[] failure"); + delete foo; + // Test nullptr handling. + foo = nullptr; + delete foo; + + auto bar = new long; + assert_ptr_not_null(bar, "Unexpected new failure"); + delete bar; + // Test nullptr handling. + bar = nullptr; + delete bar; +} +TEST_END + +int +main() { + return test( + test_basic); +} |