minor changes

This commit is contained in:
Michele Caini 2017-01-25 12:35:35 +01:00
parent 17318fdd4e
commit 57756968ac
8 changed files with 50 additions and 168 deletions

View File

@ -6,13 +6,9 @@ TEST(Async, Send) {
auto loop = uvw::Loop::getDefault();
auto handle = loop->resource<uvw::AsyncHandle>();
bool checkErrorEvent = false;
bool checkAsyncEvent = false;
handle->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
handle->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
handle->on<uvw::AsyncEvent>([&checkAsyncEvent](const auto &, auto &hndl) {
ASSERT_FALSE(checkAsyncEvent);
@ -28,7 +24,6 @@ TEST(Async, Send) {
loop->run();
ASSERT_FALSE(checkErrorEvent);
ASSERT_TRUE(checkAsyncEvent);
}

View File

@ -6,13 +6,9 @@ TEST(Check, StartAndStop) {
auto loop = uvw::Loop::getDefault();
auto handle = loop->resource<uvw::CheckHandle>();
bool checkErrorEvent = false;
bool checkCheckEvent = false;
handle->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
handle->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
handle->on<uvw::CheckEvent>([&checkCheckEvent](const auto &, auto &hndl) {
ASSERT_FALSE(checkCheckEvent);
@ -29,7 +25,6 @@ TEST(Check, StartAndStop) {
loop->run<uvw::Loop::Mode::NOWAIT>();
ASSERT_FALSE(checkErrorEvent);
ASSERT_TRUE(checkCheckEvent);
}

View File

@ -60,9 +60,7 @@ TEST(FileReq, OpenAndClose) {
bool checkFileOpenEvent = false;
bool checkFileCloseEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&checkFileCloseEvent](const auto &, auto &) {
ASSERT_FALSE(checkFileCloseEvent);
@ -106,9 +104,7 @@ TEST(FileReq, RWChecked) {
bool checkFileWriteEvent = false;
bool checkFileReadEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::READ>>([&checkFileReadEvent](const auto &event, auto &req) {
ASSERT_FALSE(checkFileReadEvent);
@ -146,9 +142,7 @@ TEST(FileReq, RWUnchecked) {
bool checkFileWriteEvent = false;
bool checkFileReadEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::READ>>([&checkFileReadEvent](const auto &event, auto &req) {
ASSERT_FALSE(checkFileReadEvent);
@ -209,9 +203,7 @@ TEST(FileReq, Stat) {
bool checkFileStatEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::FSTAT>>([&checkFileStatEvent](const auto &, auto &req) {
ASSERT_FALSE(checkFileStatEvent);
@ -257,9 +249,7 @@ TEST(FileReq, Sync) {
bool checkFileSyncEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::FSYNC>>([&checkFileSyncEvent](const auto &, auto &req) {
ASSERT_FALSE(checkFileSyncEvent);
@ -301,9 +291,7 @@ TEST(FileReq, Datasync) {
bool checkFileDatasyncEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::FDATASYNC>>([&checkFileDatasyncEvent](const auto &, auto &req) {
ASSERT_FALSE(checkFileDatasyncEvent);
@ -345,9 +333,7 @@ TEST(FileReq, Truncate) {
bool checkFileTruncateEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::FTRUNCATE>>([&checkFileTruncateEvent](const auto &, auto &req) {
ASSERT_FALSE(checkFileTruncateEvent);
@ -391,18 +377,13 @@ TEST(FileReq, SendFile) {
bool checkFileSendFileEvent = false;
dstReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
dstReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
srcReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
dstReq->on<uvw::FsEvent<uvw::FileReq::Type::OPEN>>([&srcReq](const auto &, auto &req) {
srcReq->sendfile(static_cast<uvw::FileHandle>(req), 0, 0);
});
srcReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
srcReq->on<uvw::FsEvent<uvw::FileReq::Type::SENDFILE>>([&checkFileSendFileEvent, &dstReq](const auto &, auto &req) {
ASSERT_FALSE(checkFileSendFileEvent);
checkFileSendFileEvent = true;
@ -451,9 +432,7 @@ TEST(FileReq, Chmod) {
bool checkFileChmodEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::FCHMOD>>([&checkFileChmodEvent](const auto &, auto &req) {
ASSERT_FALSE(checkFileChmodEvent);
@ -495,9 +474,7 @@ TEST(FileReq, Utime) {
bool checkFileUtimeEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::FUTIME>>([&checkFileUtimeEvent](const auto &, auto &req) {
ASSERT_FALSE(checkFileUtimeEvent);
@ -548,9 +525,7 @@ TEST(FileReq, Chown) {
bool checkFileChownEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FileReq::Type::FCHOWN>>([&checkFileChownEvent](const auto &, auto &req) {
ASSERT_FALSE(checkFileChownEvent);

View File

@ -17,9 +17,7 @@ TEST(FsReq, MkdirAndRmdir) {
bool checkFsMkdirEvent = false;
bool checkFsRmdirEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FsReq::Type::RMDIR>>([&checkFsRmdirEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsRmdirEvent);
@ -63,9 +61,7 @@ TEST(FsReq, MkdtempAndRmdir) {
bool checkFsMkdtempEvent = false;
bool checkFsRmdirEvent = false;
request->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
request->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
request->on<uvw::FsEvent<uvw::FsReq::Type::RMDIR>>([&checkFsRmdirEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsRmdirEvent);
@ -125,19 +121,14 @@ TEST(FsReq, Stat) {
bool checkFsStatEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::STAT>>([&checkFsStatEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsStatEvent);
checkFsStatEvent = true;
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
fsReq->stat(filename);
});
@ -181,19 +172,14 @@ TEST(FsReq, Lstat) {
bool checkFsLstatEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::LSTAT>>([&checkFsLstatEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsLstatEvent);
checkFsLstatEvent = true;
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
fsReq->lstat(filename);
});
@ -238,19 +224,14 @@ TEST(FsReq, Rename) {
bool checkFsRenameEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::RENAME>>([&checkFsRenameEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsRenameEvent);
checkFsRenameEvent = true;
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename, &rename](const auto &, auto &) {
fsReq->rename(filename, rename);
});
@ -292,19 +273,14 @@ TEST(FsReq, Access) {
bool checkFsAccessEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::ACCESS>>([&checkFsAccessEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsAccessEvent);
checkFsAccessEvent = true;
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
fsReq->access(filename, R_OK);
});
@ -345,19 +321,14 @@ TEST(FsReq, Chmod) {
bool checkFsChmodEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::CHMOD>>([&checkFsChmodEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsChmodEvent);
checkFsChmodEvent = true;
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
fsReq->chmod(filename, 0644);
});
@ -398,19 +369,14 @@ TEST(FsReq, Utime) {
bool checkFsUtimeEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::UTIME>>([&checkFsUtimeEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsUtimeEvent);
checkFsUtimeEvent = true;
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
auto now = std::chrono::system_clock::now();
auto epoch = now.time_since_epoch();
@ -461,9 +427,8 @@ TEST(FsReq, LinkAndUnlink) {
bool checkFsLinkEvent = false;
bool checkFsUnlinkEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::UNLINK>>([&checkFsUnlinkEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsUnlinkEvent);
@ -476,10 +441,6 @@ TEST(FsReq, LinkAndUnlink) {
request.unlink(linkname);
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename, &linkname](const auto &, auto &) {
fsReq->link(filename, linkname);
});
@ -525,9 +486,8 @@ TEST(FsReq, SymlinkAndUnlink) {
bool checkFsLinkEvent = false;
bool checkFsUnlinkEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::UNLINK>>([&checkFsUnlinkEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsUnlinkEvent);
@ -540,10 +500,6 @@ TEST(FsReq, SymlinkAndUnlink) {
request.unlink(linkname);
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename, &linkname](const auto &, auto &) {
fsReq->symlink(filename, linkname, 0);
});
@ -588,9 +544,8 @@ TEST(FsReq, Readlink) {
bool checkFsReadlinkEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::READLINK>>([&checkFsReadlinkEvent, &linkname](const auto &, auto &request) {
ASSERT_FALSE(checkFsReadlinkEvent);
@ -602,10 +557,6 @@ TEST(FsReq, Readlink) {
request.readlink(linkname);
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename, &linkname](const auto &, auto &) {
fsReq->symlink(filename, linkname, 0);
});
@ -652,9 +603,8 @@ TEST(FsReq, Realpath) {
bool checkFsRealpathEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::REALPATH>>([&checkFsRealpathEvent](const auto &event, auto &) {
ASSERT_FALSE(checkFsRealpathEvent);
@ -662,10 +612,6 @@ TEST(FsReq, Realpath) {
checkFsRealpathEvent = true;
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
fsReq->realpath(filename);
});
@ -710,9 +656,8 @@ TEST(FsReq, Chown) {
bool checkFsChownEvent = false;
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fsReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
fsReq->on<uvw::FsEvent<uvw::FsReq::Type::CHOWN>>([&checkFsChownEvent](const auto &, auto &) {
ASSERT_FALSE(checkFsChownEvent);
@ -723,10 +668,6 @@ TEST(FsReq, Chown) {
request.chown(filename, event.stat.st_uid, event.stat.st_gid);
});
fileReq->on<uvw::ErrorEvent>([](const auto &, auto &) {
FAIL();
});
fileReq->on<uvw::FsEvent<uvw::FileReq::Type::CLOSE>>([&fsReq, &filename](const auto &, auto &) {
fsReq->stat(filename);
});

View File

@ -6,13 +6,9 @@ TEST(Idle, StartAndStop) {
auto loop = uvw::Loop::getDefault();
auto handle = loop->resource<uvw::IdleHandle>();
bool checkErrorEvent = false;
bool checkIdleEvent = false;
handle->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
handle->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
handle->on<uvw::IdleEvent>([&checkIdleEvent](const auto &, auto &hndl) {
ASSERT_FALSE(checkIdleEvent);
@ -29,7 +25,6 @@ TEST(Idle, StartAndStop) {
loop->run();
ASSERT_FALSE(checkErrorEvent);
ASSERT_TRUE(checkIdleEvent);
}

View File

@ -6,13 +6,9 @@ TEST(Prepare, StartAndStop) {
auto loop = uvw::Loop::getDefault();
auto handle = loop->resource<uvw::PrepareHandle>();
bool checkErrorEvent = false;
bool checkPrepareEvent = false;
handle->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
handle->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
handle->on<uvw::PrepareEvent>([&checkPrepareEvent](const auto &, auto &hndl) {
ASSERT_FALSE(checkPrepareEvent);
@ -29,7 +25,6 @@ TEST(Prepare, StartAndStop) {
loop->run();
ASSERT_FALSE(checkErrorEvent);
ASSERT_TRUE(checkPrepareEvent);
}

View File

@ -7,19 +7,11 @@ TEST(Timer, StartAndStop) {
auto handleNoRepeat = loop->resource<uvw::TimerHandle>();
auto handleRepeat = loop->resource<uvw::TimerHandle>();
bool checkErrorEvent = false;
bool checkTimerNoRepeatEvent = false;
bool checkTimerRepeatEvent = false;
handleNoRepeat->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
handleRepeat->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
handleNoRepeat->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
handleRepeat->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
handleNoRepeat->on<uvw::TimerEvent>([&checkTimerNoRepeatEvent](const auto &, auto &handle) {
ASSERT_FALSE(checkTimerNoRepeatEvent);
@ -51,7 +43,6 @@ TEST(Timer, StartAndStop) {
loop->run();
ASSERT_FALSE(checkErrorEvent);
ASSERT_TRUE(checkTimerNoRepeatEvent);
ASSERT_TRUE(checkTimerRepeatEvent);
}
@ -62,7 +53,7 @@ TEST(Timer, Again) {
auto handle = loop->resource<uvw::TimerHandle>();
bool checkErrorEvent = false;
bool checkTimerEvent = true;
bool checkTimerEvent = false;
handle->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);

View File

@ -5,7 +5,6 @@
TEST(Work, RunTask) {
auto loop = uvw::Loop::getDefault();
bool checkErrorEvent = false;
bool checkWorkEvent = false;
bool checkTask = false;
@ -14,20 +13,16 @@ TEST(Work, RunTask) {
checkTask = true;
});
req->on<uvw::ErrorEvent>([](const auto &, auto &) { FAIL(); });
req->on<uvw::WorkEvent>([&checkWorkEvent](const auto &, auto &) {
ASSERT_FALSE(checkWorkEvent);
checkWorkEvent = true;
});
req->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
req->queue();
loop->run();
ASSERT_FALSE(checkErrorEvent);
ASSERT_TRUE(checkWorkEvent);
ASSERT_TRUE(checkTask);
}
@ -44,16 +39,16 @@ TEST(Work, Cancellation) {
checkTask = true;
});
req->on<uvw::WorkEvent>([&checkWorkEvent](const auto &, auto &) {
ASSERT_FALSE(checkWorkEvent);
checkWorkEvent = true;
});
req->on<uvw::ErrorEvent>([&checkErrorEvent](const auto &, auto &) {
ASSERT_FALSE(checkErrorEvent);
checkErrorEvent = true;
});
req->on<uvw::WorkEvent>([&checkWorkEvent](const auto &, auto &) {
ASSERT_FALSE(checkWorkEvent);
checkWorkEvent = true;
});
req->queue();
req->cancel();
loop->run();