mirror of
https://github.com/gelldur/EventBus.git
synced 2024-12-27 12:21:02 +08:00
Update test
This commit is contained in:
parent
69ac64a3ee
commit
181b89d263
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user