summaryrefslogtreecommitdiffstats
path: root/deps/jemalloc/test/integration/cpp/basic.cpp
blob: c1cf6cd87c60180d417578d004abbec7613c1dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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);
}