Update test

This commit is contained in:
Dawid Drozd 2020-04-12 14:57:09 +02:00
parent 69ac64a3ee
commit 181b89d263

View File

@ -24,7 +24,7 @@ struct EventTest
}; };
} // namespace } // namespace
TEST_CASE("Should not be proccessed with unnecessary delay", "[concurrent][EventBus]") TEST_CASE("Should not be processed with unnecessary delay", "[concurrent][EventBus]")
{ {
auto bus = std::make_shared<dexode::eventbus::perk::PerkEventBus>(); auto bus = std::make_shared<dexode::eventbus::perk::PerkEventBus>();
bus->addPerk(std::make_unique<dexode::eventbus::perk::WaitPerk>()) bus->addPerk(std::make_unique<dexode::eventbus::perk::WaitPerk>())
@ -44,10 +44,10 @@ TEST_CASE("Should not be proccessed with unnecessary delay", "[concurrent][Event
std::this_thread::sleep_for(3ms); std::this_thread::sleep_for(3ms);
}); });
// Worker which will send event every 10 ms
std::atomic<bool> isWorking = true; std::atomic<bool> isWorking = true;
std::vector<std::thread> producers; std::vector<std::thread> producers;
// Worker which will send event every 500 ms
producers.emplace_back([&bus, &isWorking]() { producers.emplace_back([&bus, &isWorking]() {
while(isWorking) while(isWorking)
{ {