Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed DRV88255 TextLCD Ping mbed-rtos
Diff: testing.cpp
- Revision:
- 21:17dd0d778bda
- Parent:
- 19:ee89eabe1fa2
- Child:
- 22:4b5bf1c2e1ff
- Child:
- 24:eeef4009640d
--- a/testing.cpp Mon Jun 13 12:51:19 2016 +0000 +++ b/testing.cpp Mon Jun 13 12:57:14 2016 +0000 @@ -1,8 +1,10 @@ +#include "mbed.h" + #include "MockSensorController.h" #include "AlarmController.h" #include "testing.h" - +#define NUMBER_OF_SEC_BEFORE_CRITICAL_ALARM 30 void TestCase::assertTrue(bool b, const char *error) { if(!b) { @@ -20,7 +22,11 @@ DEF_MOCKS(temp_mock1, salt_mock1, prox_mock1); AlarmController alarm(false,0,&temp,&salt,&prox); - alarm.run(); + for(int i = 0; i < NUMBER_OF_SEC_BEFORE_CRITICAL_ALARM+5; i++) { + alarm.run(); + Thread::wait(1000); + } + return alarm.is_error(); }