feat/support_fiber #2
@ -7,7 +7,7 @@ namespace fiber {
|
||||
namespace detail {
|
||||
|
||||
TEST(Fiber, Base) {
|
||||
constexpr auto kMaxCnt = 5000;
|
||||
constexpr auto kMaxCnt = 5000000;
|
||||
int cnt = 0;
|
||||
|
||||
// 0 -> master fiber
|
||||
@ -24,16 +24,14 @@ TEST(Fiber, Base) {
|
||||
ASSERT_EQ(Fiber::Current(), fibers[i].get());
|
||||
++cnt;
|
||||
Fiber::MasterFiber()->Resume();
|
||||
TILE_LOG_INFO("worke cnt: {}", cnt);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
while (cnt < kMaxCnt) {
|
||||
int old = cnt;
|
||||
auto next_fiber = fibers[Random(1, 1)].get();
|
||||
auto next_fiber = fibers[Random(1, 9)].get();
|
||||
|
||||
TILE_LOG_INFO("cnt: {}", cnt);
|
||||
next_fiber->Resume();
|
||||
ASSERT_EQ(old + 1, cnt);
|
||||
ASSERT_EQ(Fiber::Current(), Fiber::MasterFiber());
|
||||
|
Loading…
x
Reference in New Issue
Block a user