![]() |
R-Type
2
Doom but in better
|
#include "Tests.hpp"
Go to the source code of this file.
Functions | |
void | printMessage (GameMessage &msg) |
void | cleanup (void) |
Cleans up any resources or states after tests. | |
int | test_zipper (void) |
Test the functionality of the Zipper class. | |
int | test_indexed_zipper (void) |
Test the functionality of the IndexedZipper class. | |
int | test_create_registry (void) |
Test function for creating a registry. | |
int | test_run_systems (void) |
Test function for running systems within the registry. | |
int | test_create_game (void) |
Test function for creating a game. | |
int | test_run_update (void) |
Test function for running the game's update cycle. | |
int | test_get_game_event (void) |
Test retrieving game events from the Game instance. | |
int | test_send_msg (void) |
Test sending a message to the Game instance. | |
int | test_stress (void) |
Test for stress and performance. | |
Variables | |
EventDispatcher * | ev = nullptr |
Registry * | r = nullptr |
Game * | g = nullptr |
Queue * | q = nullptr |
void cleanup | ( | void | ) |
|
inline |
int test_create_game | ( | void | ) |
Test function for creating a game.
The test_create_game
function tests the initialization of a game, ensuring that all game components are properly set up and ready for use.
int test_create_registry | ( | void | ) |
Test function for creating a registry.
The test_create_registry
function tests the creation of a registry object, verifying its initialization and ensuring that it functions as expected.
int test_get_game_event | ( | void | ) |
Test retrieving game events from the Game instance.
This test ensures that the Game object updates correctly and retrieves game events. It deserializes each event and prints its type and ID to verify the functionality.
int test_indexed_zipper | ( | void | ) |
Test the functionality of the IndexedZipper class.
This test verifies that the IndexedZipper class correctly zips two vectors containing optional values, along with their respective indices. The test iterates through the zipped tuples and checks if the values match.
int test_run_systems | ( | void | ) |
Test function for running systems within the registry.
The test_run_systems
function tests the execution of various systems within the registry, ensuring that the systems interact correctly with the components and entities.
int test_run_update | ( | void | ) |
Test function for running the game's update cycle.
The test_run_update
function tests the game's update logic, simulating a game loop and verifying that game states and entities are correctly updated.
int test_send_msg | ( | void | ) |
Test sending a message to the Game instance.
This test verifies that a message can be serialized, sent to the Game instance, and processed correctly. The Game object updates, retrieves game events, and deserializes them to validate the process.
int test_stress | ( | void | ) |
int test_zipper | ( | void | ) |
Test the functionality of the Zipper class.
This test verifies that the Zipper class correctly zips two vectors containing optional values. The test iterates through the zipped pairs and checks if the values match.
EventDispatcher* ev = nullptr |