Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. /********************************* Includes **********************************/
  2. #include "Arduino.h"
  3. #include "Blinky.h"
  4.  
  5. #include <SimpleTest.h>
  6.  
  7. /****************************** Example settings *****************************/
  8.  
  9. /**************************** Constants and Types ****************************/
  10.  
  11. /********************************* Variables *********************************/
  12. static unsigned int requested_delay;
  13.  
  14. /************************* Local Function Prototypes *************************/
  15.  
  16. /***************************** Exported Functions ****************************/
  17. SimpleTest_Initialize();
  18. SimpleTest_CreateTest(TestExample)
  19. {
  20. Blinky_BlinkOnce();
  21. SimpleTest_AssertInteger(requested_delay, 100, "Not correct delay requested!");
  22. }
  23. SimpleTest_FinalizeTest()
  24.  
  25. static char* runTests()
  26. {
  27. SimpleTest_RunTest(TestExample);
  28. return NULL;
  29. }
  30.  
  31. int main(int argc, char **argv)
  32. {
  33. const char* testsResult = runTests();
  34. printf("%s\n", (testsResult == NULL) ? "All tests passed" : testsResult);
  35. printf("Tests run: %d\n", SimpleTestCounter);
  36. return (testsResult != NULL);
  37. }
  38.  
  39. /****************************** Local Functions ******************************/
  40. void delay(unsigned long milliseconds)
  41. {
  42. requested_delay = milliseconds;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement