added tests

This commit is contained in:
Neeflix
2018-06-28 00:25:26 +02:00
parent 66dd3f2b42
commit 252dbeca47
61 changed files with 4867 additions and 14 deletions

View File

@@ -14,10 +14,10 @@
using namespace Input;
Detector::Detector(InputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier) :
Detector::Detector(IInputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier) :
input_gpio_interface(input_gpio_interface), events(events), is_running(true), event_notifier(event_notifier)
{
detect_thread = std::thread(&Detector::detect, this);
this->detect_thread = std::thread(&Detector::detect, this);
CLOG(WARNING, INPUT_LOGGER) << "Created Detector";
}
@@ -41,7 +41,7 @@ void Detector::detect()
while(is_running)
{
char address;
if(check_inputs(address))
if(this->check_inputs(address))
{
try
{
@@ -58,7 +58,7 @@ void Detector::detect()
bool Detector::check_inputs(char& address)
{
for(int pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++)
for(char pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++)
{
if(input_gpio_interface->read_input_data(pin))
{