mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
This allows a guarantee that operator new never throws. Fix the .gitignore rules to include test/integration/cpp while we're here.
24 lines
411 B
C++
24 lines
411 B
C++
#include "test/jemalloc_test.h"
|
|
|
|
TEST_BEGIN(test_basic) {
|
|
auto foo = new long(4);
|
|
expect_ptr_not_null(foo, "Unexpected new[] failure");
|
|
delete foo;
|
|
// Test nullptr handling.
|
|
foo = nullptr;
|
|
delete foo;
|
|
|
|
auto bar = new long;
|
|
expect_ptr_not_null(bar, "Unexpected new failure");
|
|
delete bar;
|
|
// Test nullptr handling.
|
|
bar = nullptr;
|
|
delete bar;
|
|
}
|
|
TEST_END
|
|
|
|
int
|
|
main() {
|
|
return test(
|
|
test_basic);
|
|
}
|