fix: Fix issues clang-tidy found (#1708)

Fixes #1706.
This commit is contained in:
Sergey Kuznetsov
2024-10-25 11:48:18 +01:00
committed by Alex Kremer
parent 164387cab0
commit 4947a83696
5 changed files with 45 additions and 15 deletions

View File

@@ -165,3 +165,17 @@ TEST_F(CoroutineGroupTests, TooManyCoroutines)
callback3_.Call();
});
}
TEST_F(CoroutineGroupTests, CanSpawn)
{
EXPECT_CALL(callback1_, Call);
runSpawn([this](boost::asio::yield_context yield) {
CoroutineGroup group{yield, 1};
EXPECT_TRUE(group.canSpawn());
group.spawn(yield, [&group, this](boost::asio::yield_context) {
callback1_.Call();
EXPECT_FALSE(group.canSpawn());
});
});
}