fixed tests: work
This commit is contained in:
parent
9747599e3e
commit
68af870e50
@ -41,7 +41,6 @@ TEST(Work, Cancellation) {
|
||||
auto handle = loop->resource<uvw::CheckHandle>();
|
||||
|
||||
bool checkErrorEvent = false;
|
||||
bool checkWorkEvent = false;
|
||||
bool checkTask = false;
|
||||
|
||||
handle->on<uvw::CheckEvent>([](const auto &, auto &hndl) {
|
||||
@ -59,9 +58,8 @@ TEST(Work, Cancellation) {
|
||||
checkErrorEvent = true;
|
||||
});
|
||||
|
||||
req->on<uvw::WorkEvent>([&checkWorkEvent](const auto &, auto &) {
|
||||
ASSERT_FALSE(checkWorkEvent);
|
||||
checkWorkEvent = true;
|
||||
req->on<uvw::WorkEvent>([](const auto &, auto &) {
|
||||
while(true); /* it won't finish before the cancellation: guaranteed. */
|
||||
});
|
||||
|
||||
handle->start();
|
||||
@ -70,6 +68,5 @@ TEST(Work, Cancellation) {
|
||||
loop->run();
|
||||
|
||||
ASSERT_TRUE(checkErrorEvent);
|
||||
ASSERT_FALSE(checkWorkEvent);
|
||||
ASSERT_FALSE(checkTask);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user