Skip to content

Commit

Permalink
fix crash on gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
petiaccja committed Feb 20, 2024
1 parent 9b68352 commit ef60074
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions include/asyncpp/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ namespace impl_stream {
void await_suspend(std::coroutine_handle<promise> handle) const noexcept {
auto& owner = handle.promise();
assert(owner.m_event);
assert(owner.m_result.has_value());
owner.m_event->set(std::move(owner.m_result));
}

Expand Down
7 changes: 2 additions & 5 deletions include/asyncpp/testing/interleaver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,5 @@ class interleaver {
} // namespace asyncpp::testing


#define INTERLEAVED_RUN(SCENARIO, ...) \
asyncpp::testing::interleaver<SCENARIO>({ __VA_ARGS__ }).run()

#define THREAD(NAME, METHOD) \
asyncpp::testing::thread_function(NAME, METHOD)
#define INTERLEAVED_RUN(SCENARIO, ...) asyncpp::testing::interleaver<SCENARIO>({ __VA_ARGS__ }).run()
#define THREAD(NAME, METHOD) asyncpp::testing::thread_function(NAME, METHOD)
6 changes: 4 additions & 2 deletions test/test_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ TEST_CASE("Stream: data types", "[Stream]") {
};
auto r = []() -> monitor_task {
auto s = coro();
REQUIRE(*(co_await s) == 0);
auto item = co_await s;
REQUIRE(*item == 0);
}();
REQUIRE(r.get_counters().done);
}
Expand All @@ -64,7 +65,8 @@ TEST_CASE("Stream: data types", "[Stream]") {
};
auto r = []() -> monitor_task {
auto s = coro();
REQUIRE(&*(co_await s) == &value);
auto item = co_await s;
REQUIRE(&*item == &value);
}();
REQUIRE(r.get_counters().done);
}
Expand Down

0 comments on commit ef60074

Please sign in to comment.