Zhang Xin yu
/
ZhangXinyu201090208
zhangxinyu01text
Diff: main.cpp
- Revision:
- 9:6e8964c19459
- Parent:
- 8:d8e9de797e90
--- a/main.cpp Sun Mar 05 16:47:15 2017 +0000 +++ b/main.cpp Mon Apr 16 17:53:30 2018 +0000 @@ -4,6 +4,10 @@ #include "N5110.h" #include "PongEngine.h" +#ifdef WITH_TESTING +# include "tests.h" +#endif + #define PADDLE_WIDTH 2 #define PADDLE_HEIGHT 10 #define BALL_RADIUS 2 @@ -28,6 +32,12 @@ ///////////// functions //////////////// int main() { +#ifdef WITH_TESTING + int n_failures = run_all_tests(); + + if(n_failures) return n_failures; +#endif + int fps = 8; // Initialise hardware