From 112828c677f2b9d452ea4f286de19f3268fafdf8 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 31 Jul 2020 17:06:52 +0200 Subject: [PATCH] test: make work.cpp run correcty also on Windows --- test/uvw/work.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/uvw/work.cpp b/test/uvw/work.cpp index ff0bea3f..1b93b54f 100644 --- a/test/uvw/work.cpp +++ b/test/uvw/work.cpp @@ -6,16 +6,8 @@ TEST(Work, RunTask) { auto loop = uvw::Loop::getDefault(); auto handle = loop->resource(); - bool checkWorkEvent = false; bool checkTask = false; - handle->on([&checkWorkEvent](const auto &, auto &hndl) { - if(checkWorkEvent) { - hndl.stop(); - hndl.close(); - } - }); - auto req = loop->resource([&checkTask]() { ASSERT_FALSE(checkTask); checkTask = true; @@ -23,16 +15,14 @@ TEST(Work, RunTask) { req->on([](const auto &, auto &) { FAIL(); }); - req->on([&checkWorkEvent](const auto &, auto &) { - ASSERT_FALSE(checkWorkEvent); - checkWorkEvent = true; + req->on([&handle](const auto &, auto &) { + handle->close(); }); handle->start(); req->queue(); loop->run(); - ASSERT_TRUE(checkWorkEvent); ASSERT_TRUE(checkTask); }