stdexec: update to later commit
The upstream code has done some namespace changes. Point to a commit
in that timeframe and fix up the local usages in order to compile
successfully.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5a21ccd0774ee5cd22d45c9a425e43560734a571
diff --git a/test/async/context.cpp b/test/async/context.cpp
index 6e688c7..03480c9 100644
--- a/test/async/context.cpp
+++ b/test/async/context.cpp
@@ -15,8 +15,8 @@
void spawnStop()
{
- ctx->spawn(std::execution::just() |
- std::execution::then([this]() { ctx->request_stop(); }));
+ ctx->spawn(stdexec::just() |
+ stdexec::then([this]() { ctx->request_stop(); }));
}
void runToStop()
@@ -35,7 +35,7 @@
TEST_F(Context, SpawnedTask)
{
- ctx->spawn(std::execution::just());
+ ctx->spawn(stdexec::just());
runToStop();
}
@@ -50,8 +50,8 @@
TEST_F(Context, SpawnThrowingTask)
{
- ctx->spawn(std::execution::just() |
- std::execution::then([]() { throw std::logic_error("Oops"); }));
+ ctx->spawn(stdexec::just() |
+ stdexec::then([]() { throw std::logic_error("Oops"); }));
EXPECT_THROW(runToStop(), std::logic_error);
ctx->run();
@@ -62,9 +62,8 @@
static constexpr size_t count = 100;
for (size_t i = 0; i < count; ++i)
{
- ctx->spawn(std::execution::just() | std::execution::then([]() {
- throw std::logic_error("Oops");
- }));
+ ctx->spawn(stdexec::just() |
+ stdexec::then([]() { throw std::logic_error("Oops"); }));
}
spawnStop();
@@ -84,7 +83,7 @@
bool ran = false;
ctx->spawn(sdbusplus::async::sleep_for(*ctx, timeout) |
- std::execution::then([&ran]() { ran = true; }));
+ stdexec::then([&ran]() { ran = true; }));
runToStop();
@@ -107,16 +106,15 @@
++executed;
co_return (co_await one(count - 1, executed)) + 1;
}
- co_return co_await std::execution::just(0);
+ co_return co_await stdexec::just(0);
}
};
static constexpr size_t count = 100;
size_t executed = 0;
- ctx->spawn(_::one(count, executed) | std::execution::then([=](auto result) {
- EXPECT_EQ(result, count);
- }));
+ ctx->spawn(_::one(count, executed) |
+ stdexec::then([=](auto result) { EXPECT_EQ(result, count); }));
runToStop();
@@ -133,11 +131,11 @@
"/this/is/a/bogus/path/for/SpawnMatcher"));
// Await the match completion (which will never happen).
- ctx->spawn(m->next() | std::execution::then([&ran](...) { ran = true; }));
+ ctx->spawn(m->next() | stdexec::then([&ran](...) { ran = true; }));
// Destruct the match.
ctx->spawn(sdbusplus::async::sleep_for(*ctx, 1ms) |
- std::execution::then([&m](...) { m.reset(); }));
+ stdexec::then([&m](...) { m.reset(); }));
EXPECT_THROW(runToStop(), sdbusplus::exception::UnhandledStop);
EXPECT_NO_THROW(ctx->run());
@@ -166,7 +164,7 @@
bool ran = false;
ctx->spawn(_::fn(m->next(), ran));
ctx->spawn(sdbusplus::async::sleep_for(*ctx, 1ms) |
- std::execution::then([&]() { m.reset(); }));
+ stdexec::then([&]() { m.reset(); }));
EXPECT_THROW(runToStop(), sdbusplus::exception::UnhandledStop);
EXPECT_NO_THROW(ctx->run());
diff --git a/test/async/task.cpp b/test/async/task.cpp
index 6ee90f8..a7e5a15 100644
--- a/test/async/task.cpp
+++ b/test/async/task.cpp
@@ -17,7 +17,7 @@
EXPECT_FALSE(value);
// Run it and confirm the value is updated.
- std::this_thread::sync_wait(t());
+ stdexec::this_thread::sync_wait(t());
EXPECT_TRUE(value);
}
@@ -41,7 +41,7 @@
// Add boolean to confirm that co-routine actually executed by the
// end.
bool executed = false;
- std::this_thread::sync_wait(_::two(executed));
+ stdexec::this_thread::sync_wait(_::two(executed));
EXPECT_TRUE(executed);
}
@@ -69,11 +69,11 @@
};
// Ensure throws surface up.
- EXPECT_THROW(std::this_thread::sync_wait(_::one()), std::logic_error);
+ EXPECT_THROW(stdexec::this_thread::sync_wait(_::one()), std::logic_error);
// Ensure throws can be caught inside a co-routine.
bool caught = false;
- std::this_thread::sync_wait(_::two(caught));
+ stdexec::this_thread::sync_wait(_::two(caught));
EXPECT_TRUE(caught);
}
@@ -88,16 +88,16 @@
++executed;
co_return (co_await one(count - 1, executed)) + 1;
}
- co_return co_await std::execution::just(0);
+ co_return co_await stdexec::just(0);
}
};
static constexpr size_t count = 100;
size_t executed = 0;
- std::this_thread::sync_wait(
+ stdexec::this_thread::sync_wait(
_::one(count, executed) |
- std::execution::then([=](auto result) { EXPECT_EQ(result, count); }));
+ stdexec::then([=](auto result) { EXPECT_EQ(result, count); }));
EXPECT_EQ(executed, count);
}
diff --git a/test/async/timer.cpp b/test/async/timer.cpp
index 07e7de7..7aee04f 100644
--- a/test/async/timer.cpp
+++ b/test/async/timer.cpp
@@ -15,7 +15,7 @@
auto start = std::chrono::steady_clock::now();
ctx.spawn(sdbusplus::async::sleep_for(ctx, timeout) |
- std::execution::then([&ctx]() { ctx.request_stop(); }));
+ stdexec::then([&ctx]() { ctx.request_stop(); }));
ctx.run();
auto stop = std::chrono::steady_clock::now();