From 323904c7d527e381e4f5468eb62ae08acb10cbd6 Mon Sep 17 00:00:00 2001 From: isidorostsa Date: Thu, 14 Dec 2023 13:03:36 +0200 Subject: [PATCH] tidying up tests --- .../unit/algorithms/uninitialized_relocate.cpp | 8 ++++---- .../algorithms/uninitialized_relocate_backward.cpp | 14 +++++++------- .../unit/algorithms/uninitialized_relocaten.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate.cpp index e612ff1773c9..b90c99a938f0 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate.cpp @@ -27,7 +27,7 @@ using hpx::experimental::uninitialized_relocate; std::mutex m; template -void lazy_mutex_op(F&& f) +void simple_mutex_operation(F&& f) { std::lock_guard lk(m); f(); @@ -53,7 +53,7 @@ struct counted_struct : data(data) { // Check that we are not constructing an object on top of another - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { HPX_TEST(!made.count(this)); made.insert(this); }); @@ -76,7 +76,7 @@ struct counted_struct } // Check that we are not constructing an object on top of another - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { // Unless we are testing overlapping relocation // we should not be move-constructing an object on top of another if constexpr (!overlapping_test) @@ -93,7 +93,7 @@ struct counted_struct // Check that the object was constructed // and not already destroyed - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { HPX_TEST(made.count(this)); made.erase(this); }); diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_backward.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_backward.cpp index 04fea6e3f3bd..cd787db3e2ad 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_backward.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_backward.cpp @@ -14,9 +14,9 @@ #include #include -constexpr int N = 50; // number of objects to construct -constexpr int M = 20; // number of objects to relocate -constexpr int K = 10; // number of objects to relocate before throwing +constexpr int N = 500; // number of objects to construct +constexpr int M = 200; // number of objects to relocate +constexpr int K = 100; // number of objects to relocate before throwing static_assert(N > M); static_assert(M > K); @@ -27,7 +27,7 @@ using hpx::experimental::uninitialized_relocate_backward; std::mutex m; template -void lazy_mutex_op(F&& f) +void simple_mutex_operation(F&& f) { std::lock_guard lk(m); f(); @@ -53,7 +53,7 @@ struct counted_struct : data(data) { // Check that we are not constructing an object on top of another - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { HPX_TEST(!made.count(this)); made.insert(this); }); @@ -76,7 +76,7 @@ struct counted_struct } // Check that we are not constructing an object on top of another - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { // Unless we are testing overlapping relocation // we should not be move-constructing an object on top of another if constexpr (!overlapping_test) @@ -93,7 +93,7 @@ struct counted_struct // Check that the object was constructed // and not already destroyed - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { HPX_TEST(made.count(this)); made.erase(this); }); diff --git a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocaten.cpp b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocaten.cpp index 68fc92aecfdf..45e0780de33d 100644 --- a/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocaten.cpp +++ b/libs/core/algorithms/tests/unit/algorithms/uninitialized_relocaten.cpp @@ -27,7 +27,7 @@ using hpx::experimental::uninitialized_relocate_n; std::mutex m; template -void lazy_mutex_op(F&& f) +void simple_mutex_operation(F&& f) { std::lock_guard lk(m); f(); @@ -53,7 +53,7 @@ struct counted_struct : data(data) { // Check that we are not constructing an object on top of another - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { HPX_TEST(!made.count(this)); made.insert(this); }); @@ -76,7 +76,7 @@ struct counted_struct } // Check that we are not constructing an object on top of another - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { // Unless we are testing overlapping relocation // we should not be move-constructing an object on top of another if constexpr (!overlapping_test) @@ -93,7 +93,7 @@ struct counted_struct // Check that the object was constructed // and not already destroyed - lazy_mutex_op([&]() { + simple_mutex_operation([&]() { HPX_TEST(made.count(this)); made.erase(this); });