From 5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 21 Jan 2026 22:40:55 +0100 Subject: Add Redis source code for testing --- .../deps/jemalloc/test/integration/cpp/basic.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 examples/redis-unstable/deps/jemalloc/test/integration/cpp/basic.cpp (limited to 'examples/redis-unstable/deps/jemalloc/test/integration/cpp/basic.cpp') diff --git a/examples/redis-unstable/deps/jemalloc/test/integration/cpp/basic.cpp b/examples/redis-unstable/deps/jemalloc/test/integration/cpp/basic.cpp new file mode 100644 index 0000000..c1cf6cd --- /dev/null +++ b/examples/redis-unstable/deps/jemalloc/test/integration/cpp/basic.cpp @@ -0,0 +1,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); +} -- cgit v1.2.3