little readme change

This commit is contained in:
Neeflix
2018-07-10 21:08:34 +02:00
parent 202cfbe8c0
commit 22552f9acd
4 changed files with 41 additions and 4 deletions

View File

@@ -13,7 +13,7 @@
class IEventHandler class IEventHandler
{ {
public: public:
virtual ~IEventHandler() = 0; virtual ~IEventHandler(){};
virtual void handle(Input::Event& event) = 0; virtual void handle(Input::Event& event) = 0;
}; };

View File

@@ -27,7 +27,7 @@ using namespace Input;
SCENARIO("Creating a Detector object", "") SCENARIO("Creating a Detector object", "")
{ {
GIVEN("An IEventNofifier, two Events and an IInputGPIOInterface") GIVEN("An IEventNofifier, three Events and an IInputGPIOInterface")
{ {
LoggerFactory::CreateInputLogger(); LoggerFactory::CreateInputLogger();

View File

@@ -5,3 +5,40 @@
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
*/ */
#include "../catch.hpp"
#include "../fakeit.hpp"
#include "../../src/utilities/LoggerFactory.hpp"
#include "../../src/input/EventHandler.h"
#include "../../src/input/IInputDriver.h"
// testing purposes
#define private public
using namespace fakeit;
SCENARIO("An EventHandler gets created", "[construction}")
{
GIVEN("An IInputDriver")
{
LoggerFactory::CreateInputLogger();
Mock<Input::IInputDriver> input_driver_mock;
Fake(Dtor(input_driver_mock));
When(Method(input_driver_mock, register_event_handler)).AlwaysReturn();
When(Method(input_driver_mock, operator=)).AlwaysReturn();
WHEN("the event handler gets created")
{
std::shared_ptr<Input::IInputDriver> driver_ptr(&input_driver_mock.get());
Input::EventHandler handler(driver_ptr);
THEN("It should register itself at the input_driver")
{
REQUIRE((bool)Verify(Method(input_driver_mock, register_event_handler).Using(&handler)));
}
}
}
}

View File

@@ -1,8 +1,8 @@
# Build the driver library ## Build the driver library
To build the flippr-driver library run the following commands: To build the flippr-driver library run the following commands:
```sh1 ```sh1
$ cd flippr-code/FlippR-Driver/build $ cd flippr-code/FlippR-Driver/build
$ cmake .. $ cmake ..
$ make $ make
``` ```
This will create you the static-library file: _flippr-code/FlippR-Driver/bin/libflippr-driver.a_ This will create you the static-library file: _flippr-code/FlippR-Driver/bin/libFlippR-Driver.a_