changed to smart ptrs and trying to fix event_handler_tests

This commit is contained in:
Jonas Zeunert
2018-07-11 19:00:24 +02:00
parent 26c63d946d
commit 8b9ec68662
12 changed files with 47 additions and 61 deletions

View File

@@ -63,13 +63,13 @@ SCENARIO("An EventHandler gets [un]registered at the notifier", "[un-register no
AND_WHEN("The EventHandler gets unregistered at the driver")
{
REQUIRE(!notifier.event_handler.empty());
REQUIRE(!notifier.event_handlers.empty());
notifier.unregister_event_handler(&event_handler_mock.get());
THEN("The list of event_handlers is empty")
{
REQUIRE(notifier.event_handler.empty());
REQUIRE(notifier.event_handlers.empty());
}
}
}
@@ -86,6 +86,7 @@ SCENARIO("An event should be distributed", "[distribute]")
Mock<IBlockingQueue<Event>> queue_mock;
When(Method(queue_mock, push)).AlwaysReturn();
When(Method(queue_mock, pop)).AlwaysDo([](){return Event(0,0,"mock");});
Fake(Dtor(queue_mock));
EventNotifier notifier;