fixed some testing bugs

This commit is contained in:
Jonas Zeunert
2018-07-10 23:49:35 +02:00
parent 14b5118038
commit cfccb67561
6 changed files with 22 additions and 12 deletions

View File

@@ -55,15 +55,16 @@ SCENARIO("Creating a Detector object", "")
Detector detector(&gpio_interface_mock.get(), events, &event_notifier_mock.get());
THEN("a thread should be created")
{
REQUIRE(typeid(detector.detect_thread).hash_code() == typeid(std::thread).hash_code());
REQUIRE(typeid(detector.detect_thread).hash_code() == typeid(std::thread).hash_code());
}
AND_WHEN("an event can be found at gpio interface")
{
THEN("only the fitting event should be distributed by event notifier")
{
REQUIRE((bool)Verify(Method(event_notifier_mock, distribute_event).Using(event2)));
}
std::this_thread::sleep_for(std::chrono::milliseconds(50));
THEN("only the fitting event should be distributed by event notifier")
{
REQUIRE((bool)Verify(Method(event_notifier_mock, distribute_event).Using(event2)));
}
}
}
}