Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Spaceship/Spaceship_test.h
- Revision:
- 85:87bc28b151d8
- Parent:
- 82:3211b31e9421
--- a/Spaceship/Spaceship_test.h Tue May 26 14:39:45 2020 +0000
+++ b/Spaceship/Spaceship_test.h Tue May 26 19:38:48 2020 +0000
@@ -2,31 +2,31 @@
#define SPACESHIP_TEST_H
/** Spaceship Test
- * @brief Checks Spcaceship move to the correct postion when moved and doesnt go
+ * @brief Checks Spaceship move to the correct position when moved and doesn’t go
* of map when being drawn
* @author Benjamin Evans, University of Leeds
* @date April 2020
* @return true if test are passed
*/
bool spaceship_movement_test(Direction d_, int expected_x,int expected_y) {
- // Objects reqired for test
+ // Objects required for test
FXOS8700CQ accelerometer(I2C_SDA,I2C_SCL);
Gamepad pad;
Spaceship spaceship;
- // Initialise spaceship in start postion of 36, 22
+ // Initialise spaceship in start position of 36, 22
pad.init();
spaceship.init();
printf("spaceship_movement = %d,%d : ", expected_x, expected_y );
- // Moves spcaeship
+ // Moves spaceship
spaceship.movement(d_);
- // Reads finish spaceship positon
+ // Reads finish spaceship position
Vector2D finish_postion = spaceship.get_pos();
- // Checks final position with espected
+ // Checks final position with expected
if (finish_postion.x == expected_x && finish_postion.y == expected_y) {
printf ( "Passed!\n");
return true;
@@ -41,21 +41,21 @@
bool spaceship_draw_test(Direction d_, int expected_pixel_status,
int expected_postion_x, int expected_postion_y) {
- // Objects reqired for test
+ // Objects required for test
Gamepad pad;
Spaceship spaceship;
N5110 lcd;
- // Initialise spaceship in start postion of 36, 22
+ // Initialise spaceship in start position of 36, 22
pad.init();
lcd.init();
spaceship.init();
- // Reads start spaceship postion
+ // Reads start spaceship position
printf("spaceship_draw x,y= %d,%d : ",expected_postion_x,
expected_postion_y );
- // Moves spcaeship to max/min x and y postions to test
+ // Moves spaceship to max/min x and y positions to test
// off_screen_x_y_checker
for (int i = 0; i < 30; i++) {
spaceship.movement(d_);
@@ -68,7 +68,7 @@
int actual_pixel_status = lcd.getPixel(expected_postion_x,
expected_postion_y);
- // Checks if pixel is drawn and therefor testing it hasnt gone of screen
+ // Checks if pixel is drawn and therefor testing it hasn’t gone of screen
if (actual_pixel_status) {
printf ( "Passed!\n");
return true;
@@ -78,4 +78,4 @@
return false;
}
}
-#endif
\ No newline at end of file
+#endif