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.
Dependencies: mbed FXOS8700CQQQ
tests Class Reference
tests class More...
#include <tests.h>
Public Member Functions | |
| tests () | |
| Default Constructor. | |
| ~tests () | |
| Default destructor. | |
| void | test_welcomeMenu (Gamepad &pad, N5110 &lcd) |
| method to test welcome menu | |
| void | test_Play_Welcome_Melody (Gamepad &pad) |
| method to test tones played in the game | |
| void | test_End_Game_Melody (Gamepad &pad) |
| method to test tones played in the game over screen | |
| void | test_drawMenu (N5110 &lcd, Gamepad &pad) |
| method to test the draw main menu method | |
| void | test_credits_page (N5110 &lcd, Gamepad &pad) |
| method to test the credits page on the menu | |
| void | test_loading_menu (N5110 &lcd) |
| method to test the loading page | |
| void | test_InstructionsMenu (Gamepad &pad, N5110 &lcd) |
| method to test the instructions page | |
| void | test_Game_Loop (Gamepad &pad, N5110 &lcd) |
| method to test the game loop which has all the game methods calls in it | |
| bool | test_Joystick_position (Gamepad &pad) |
| method to test the position of the joystick and prints its current state and return true | |
| bool | test_Generate_New_Enemy () |
| method to test generated numbers | |
| bool | test_accelerometer_position (Gamepad &pad) |
| method to test the position of the accelerometer and prints its current state and return true | |
| bool | test_check_button_pressed (Gamepad &pad, N5110 &lcd) |
| method to test button presses in the menu and return true, false otherwise | |
Detailed Description
tests class
C++ class containing the tests for methods
- Version:
- 1.0
- Date:
- April 2019
#include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "RocketRacer.h" // objects Gamepad pad; RocketRacer rc; Menus menus; tests test; int main(){ setup(); while(1){ // test.test_welcomeMenu(pad,lcd); // test.test_Play_Welcome_Melody(pad); // test.test_End_Game_Melody(Gamepad &pad); // test.test_drawMenu(lcd, pad); // test.test_credits_page(lcd,pad); // test.test_loading_menu(lcd); // test.test_InstructionsMenu(pad,lcd); // test.test_Game_Loop(pad,lcd); // test.test_Joystick_position(pad); // test.test_Generate_New_Enemy(); // test.test_Joystick_position(pad); // test_check_button_pressed(pad,lcd); test.test_accelerometer_position(pad); } }
Definition at line 62 of file tests.h.
Constructor & Destructor Documentation
| tests | ( | ) |
| ~tests | ( | ) |
Member Function Documentation
| bool test_accelerometer_position | ( | Gamepad & | pad ) |
method to test button presses in the menu and return true, false otherwise
- Parameters:
-
pad calls the Gamepad object to be passed to the methods called inside this method lcd calls the lcd object to be passed to the methods called inside this method
- Returns:
- true if the condition is met, false otherwise
| void test_End_Game_Melody | ( | Gamepad & | pad ) |
| bool test_Generate_New_Enemy | ( | ) |
| bool test_Joystick_position | ( | Gamepad & | pad ) |
| void test_loading_menu | ( | N5110 & | lcd ) |
| void test_Play_Welcome_Melody | ( | Gamepad & | pad ) |
Generated on Mon Jul 18 2022 07:45:10 by
1.7.2