Skip to content

Commit a8dc458

Browse files
Fix split test compile errors and clang-format
1 parent 97300ee commit a8dc458

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

libs/core/execution/tests/unit/algorithm_split_scheduler.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626
#include <hpx/modules/execution.hpp>
2727
#include <hpx/modules/testing.hpp>
2828

29+
#include "algorithm_test_utils.hpp"
30+
2931
#include <atomic>
3032
#include <string>
3133
#include <thread>
34+
#include <tuple>
3235
#include <vector>
3336

3437
namespace ex = hpx::execution::experimental;
@@ -41,19 +44,23 @@ int hpx_main()
4144
// Regression guard: no behavioural change for the scheduler-free path.
4245
// -----------------------------------------------------------------------
4346
{
44-
auto s = ex::split(ex::just(42, std::string("hello")));
47+
auto s = ex::split(ex::just(std::make_tuple(42, std::string("hello"))));
4548

4649
std::atomic<int> count{0};
4750

4851
// First subscriber (predecessor not yet complete when connecting)
49-
tt::sync_wait(ex::then(s, [&](int x, std::string const& msg) {
52+
tt::sync_wait(ex::then(s, [&](auto const& tuple_val) {
53+
int x = std::get<0>(tuple_val);
54+
std::string const& msg = std::get<1>(tuple_val);
5055
HPX_TEST_EQ(x, 42);
5156
HPX_TEST_EQ(msg, std::string("hello"));
5257
++count;
5358
}));
5459

5560
// Second subscriber (predecessor_done == true)
56-
tt::sync_wait(ex::then(s, [&](int x, std::string const& msg) {
61+
tt::sync_wait(ex::then(s, [&](auto const& tuple_val) {
62+
int x = std::get<0>(tuple_val);
63+
std::string const& msg = std::get<1>(tuple_val);
5764
HPX_TEST_EQ(x, 42);
5865
HPX_TEST_EQ(msg, std::string("hello"));
5966
++count;
@@ -156,8 +163,7 @@ int hpx_main()
156163
// Test 5: error propagation through split — both subscribers see error.
157164
// -----------------------------------------------------------------------
158165
{
159-
auto s = ex::split(ex::just_error(
160-
std::make_exception_ptr(std::runtime_error("oops"))));
166+
auto s = ex::split(error_sender{});
161167

162168
std::atomic<int> error_count{0};
163169

0 commit comments

Comments
 (0)