![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Diff: tests.h
- Revision:
- 74:7b6568bc16d5
- Parent:
- 69:55e309da7efd
- Child:
- 99:4841f326200f
diff -r 80556a279962 -r 7b6568bc16d5 tests.h --- a/tests.h Sun May 05 10:58:33 2019 +0000 +++ b/tests.h Sun May 05 11:46:08 2019 +0000 @@ -10,32 +10,29 @@ */ int run_all_tests() { - int n_tests_failed = 0; // A log of the number of tests that have failed + int number_of_failed_tests = 0; // A log of the number of tests that have failed - // Run the Snake_test_movement test + // Run the Snake_test_movement printf("Testing Snake_test_movement...\n"); - bool this_test_passed = Snake_test_movement(); + bool snake_movement_test_passed = Snake_test_movement(); // Print out the result of this test - if (this_test_passed) { - printf("...Passed!\n"); + if (snake_movement_test_passed) { + printf("...Passed!, no worries the game is alright\n"); } else { printf("...FAILED!\n"); - ++n_tests_failed; // Increment number of failures + ++number_of_failed_tests; // Increment number of failures } - // Repeat the above for each testing function... - // ... - // ... // Finish by printing a summary of the tests - if (n_tests_failed > 0) { - printf("%d tests FAILED!\n", n_tests_failed); + if (number_of_failed_tests > 0) { + printf("%d tests FAILED!\n", number_of_failed_tests); } else { printf("All tests passed!\n"); } - return n_tests_failed; + return number_of_failed_tests; } #endif \ No newline at end of file