Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
tests.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-05-09
- Revision:
- 99:4841f326200f
- Parent:
- 74:7b6568bc16d5
- Child:
- 103:64bc823d71f4
File content as of revision 99:4841f326200f:
#ifndef TESTS_H #define TESTS_H /** @file Tests.h * @brief Used to call Snake-test.h and check the results of the tests performed. */ #include "Snake-test.h" /** * @brief Run all the tests for this program * * @returns The number of tests that failed */ int run_all_tests() { int number_of_failed_tests = 0; // A log of the number of tests that have failed // Run the Snake_test_movement printf("Testing Snake_test_movement...\n"); bool snake_movement_test_passed = Snake_test_movement(); // Print out the result of this test if (snake_movement_test_passed) { printf("...Passed!, no worries the game is alright\n"); } else { printf("...FAILED!\n"); ++number_of_failed_tests; // Increment number of failures } // Finish by printing a summary of the tests if (number_of_failed_tests > 0) { printf("%d tests FAILED!\n", number_of_failed_tests); } else { printf("All tests passed!\n"); } return number_of_failed_tests; } #endif