
Final Commit
Dependencies: mbed
Snake/Snake-test.h
- Committer:
- JRM1986
- Date:
- 2018-05-08
- Revision:
- 27:bd0f69a75d8b
- Parent:
- 25:f03439ee32c6
File content as of revision 27:bd0f69a75d8b:
#ifndef SNAKE_TEST_H #define SNAKE_TEST_H /** * \brief Check that food changes position within game area * * \returns true if all the tests passed */ bool snake_test_movement() { bool success_flag = true; Snake snake; // next diretion test snake.set_current_direction(S); snake.set_snake_direction(N,S); Direction next = snake.get_snake_direction(); snake.set_snake_position(next); Vector2D pos = snake.get_snake_position(); printf("%c", next); printf("Position %f, %f", pos.x, pos.y); if(next == !S) { success_flag = false; } if((pos.x != 0) && (pos.y != 1)) { success_flag = false; } return success_flag; } #endif