Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions tests/beman/execution/exec-associate.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ TEST(exec_associate) {
static_assert(std::same_as<test_std::completion_signatures<test_std::set_value_t()>,
test_std::completion_signatures_of_t<snd0_t, test_std::env<>>>);

#ifndef _MSC_VER //-dk:TODO MSVC++ struggles with more than one of these test
using snd1_t = decltype(test_std::associate(test_std::just(std::string{}), null_token{}));
static_assert(std::same_as<test_std::completion_signatures<test_std::set_value_t(std::string)>,
test_std::completion_signatures_of_t<snd1_t, test_std::env<>>>);
Expand All @@ -136,10 +135,8 @@ TEST(exec_associate) {
using snd4_t = decltype(test_std::associate(test_std::just(std::ref(i)), null_token{}));
static_assert(std::same_as<test_std::completion_signatures<test_std::set_value_t(std::reference_wrapper<int>)>,
test_std::completion_signatures_of_t<snd4_t, test_std::env<>>>);
#endif
}

#ifndef _MSC_VER //-dk:TODO MSVC++ struggles with more than one of these test
// Identity behavior with null_token for value path + piping works.
{
{
Expand Down Expand Up @@ -241,5 +238,4 @@ TEST(exec_associate) {
ASSERT(completes_with_value(test_std::just(1) | test_std::associate(null_token{})));
ASSERT(!completes_with_value(test_std::just(1) | test_std::associate(expired_token{})));
}
#endif
}
9 changes: 5 additions & 4 deletions tests/beman/execution/exec-bulk.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@ struct pstl_for_each_sender {
template <typename... Args>
auto set_value(Args&&... args) noexcept -> void {
try {
auto iota = std::views::iota(Shape(0), shape);
std::for_each(policy, std::ranges::begin(iota), std::ranges::end(iota), [&](Shape i) {
auto indices = std::views::iota(Shape(0), shape);
std::for_each(policy, std::ranges::begin(indices), std::ranges::end(indices), [&](Shape i) {
if constexpr (IsChunked) {
std::invoke(fn, i, i + 1, args...);
std::invoke(fn, i, i + Shape(1), args...);
} else {
std::invoke(fn, i, args...);
};
Expand Down Expand Up @@ -430,7 +430,8 @@ struct pstl_for_each_sender {

template <typename Rcvr>
auto connect(Rcvr rcvr) && noexcept {
return test_std::connect(child, receiver{std::move(rcvr), std::move(policy), std::move(shape), std::move(fn)});
return test_std::connect(std::move(child),
receiver{std::move(rcvr), std::move(policy), std::move(shape), std::move(fn)});
}

auto get_env() const noexcept { return test_std::get_env(child); }
Expand Down
10 changes: 4 additions & 6 deletions tests/beman/execution/exec-just.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,17 @@ auto test_just_allocator() -> void {
ASSERT(resource.count == 0u);
auto copy(std::make_obj_using_allocator<std::pmr::string>(std::pmr::polymorphic_allocator<>(&resource), str));
test::use(copy);
ASSERT(resource.count == 1u);
auto old_count = resource.count;
ASSERT(old_count > 0u);

auto env{test_std::get_env(receiver)};
auto alloc{test_std::get_allocator(env)};
test::use(alloc);

ASSERT(resource.count == 1u);
ASSERT(resource.count == old_count);
auto state{test_std::connect(std::move(sender), memory_receiver{&resource})};
test::use(state);
ASSERT(resource.count == 2u);
ASSERT(resource.count > old_count);
}

auto test_completion_signatures() -> void {
Expand All @@ -220,10 +221,7 @@ TEST(exec_just) {
test_just_constraints();
test_just();
test_completion_signatures();
#ifndef _MSC_VER
//-dk:TODO re-enable allocator test for MSVC++
test_just_allocator();
#endif
} catch (...) {
// NOLINTNEXTLINE(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
ASSERT(nullptr == "the just tests shouldn't throw");
Expand Down
9 changes: 3 additions & 6 deletions tests/beman/execution/exec-then.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ struct sender {
}
};

constexpr auto consume_all = [](auto&&...) {};

template <bool Expect>
auto test_has(auto cpo, auto in_sender, auto fun) -> void {
static_assert(test_std::receiver<receiver>);
Expand All @@ -70,14 +72,9 @@ auto test_has(auto cpo, auto in_sender, auto fun) -> void {
static_assert(requires {
{ in_sender | cpo(fun) } -> test_std::sender;
});
#ifndef _MSC_VER
//-dk:TODO re-enable this test
static_assert(requires {
{
in_sender | cpo(fun) | cpo([](auto&&...) {})
} -> test_std::sender;
{ in_sender | cpo(fun) | cpo(consume_all) } -> test_std::sender;
});
#endif
auto sender{cpo(in_sender, fun)};
auto op{test_std::connect(::std::move(sender), receiver{})};
test_std::start(op);
Expand Down
Loading