aboutsummaryrefslogtreecommitdiff
path: root/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp')
-rw-r--r--pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp
index cb8b178..c41a31d 100644
--- a/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp
+++ b/pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp
@@ -149,6 +149,13 @@ main()
test_algo_basic_single<int32_t>(run_for_rnd_fw<test_non_const>());
+ test<MemoryChecker>(MemoryChecker{0}, MemoryChecker{1},
+ [](const MemoryChecker& val){ return val.value() == 1; },
+ [](std::size_t idx){ return MemoryChecker{std::int32_t(idx % 3 == 0)}; }
+ );
+ EXPECT_FALSE(MemoryChecker::alive_objects() < 0, "wrong effect from remove,remove_if: number of ctors calls < num of dtors calls");
+ EXPECT_FALSE(MemoryChecker::alive_objects() > 0, "wrong effect from remove,remove_if: number of ctors calls > num of dtors calls");
+
std::cout << done() << std::endl;
return 0;
}