@@ -58,13 +58,10 @@ void test_Controller()
5858 Menu singleMenu (board::getDisplay ());
5959 Presenter presenter (singleMenu, board::getStatusIndicators ());
6060 ProcessHmiInputs processor (presenter, board::getKeypad ());
61- auto &task1 = std::begin (device::tasks)->second ; // we are going to test for task 1
62- const auto isrTask1 = isr_collection.find (board::button::pin::task1); // ISR we expect for task 1
63- TEST_ASSERT_NOT_EQUAL (std::end (isr_collection), isrTask1); // assert we found an ISR for task 1 in the list
61+ auto &task1 = std::begin (device::tasks)->second ; // we are going to test for task 1
6462
65- std::cout << " trigger ISR for task 1: 'start task'" << std::endl;
6663 When (Method (ArduinoFake (), digitalRead).Using (board::button::pin::task1)).Return (LOW); // set task 1 button to low
67- isrTask1-> second (); // trigger interrupt for task 1 button
64+ changeButtonState (board::button::pin::task1);
6865
6966 // wait for the task to be running
7067 while (!task1.isRunning ())
@@ -75,9 +72,8 @@ void test_Controller()
7572 constexpr int millisecondsToWait = 1000 ;
7673 std::this_thread::sleep_for (std::chrono::milliseconds (millisecondsToWait)); // wait a defined time
7774
78- std::cout << " trigger ISR for task 1: 'stop task'" << std::endl;
7975 When (Method (ArduinoFake (), digitalRead).Using (board::button::pin::task1)).Return (LOW); // set task 1 button to low
80- isrTask1-> second (); // stop task
76+ changeButtonState (board::button::pin::task1); // stop task
8177
8278 // wait for the task to be stopped
8379 while (task1.isRunning ())
0 commit comments