| 32 | |
| 33 | |
| 34 | TEST(LoopTest, Sync) |
| 35 | { |
| 36 | std::atomic_int value = ATOMIC_VAR_INIT(1); |
| 37 | |
| 38 | Future<Nothing> future = loop( |
| 39 | [&]() { |
| 40 | return value.load(); |
| 41 | }, |
| 42 | [](int i) -> ControlFlow<Nothing> { |
| 43 | if (i != 0) { |
| 44 | return Continue(); |
| 45 | } |
| 46 | return Break(); |
| 47 | }); |
| 48 | |
| 49 | EXPECT_TRUE(future.isPending()); |
| 50 | |
| 51 | value.store(0); |
| 52 | |
| 53 | AWAIT_READY(future); |
| 54 | } |
| 55 | |
| 56 | |
| 57 | TEST(LoopTest, Async) |
nothing calls this directly
no test coverage detected