10 #include <gtest/gtest.h>
11 #include <game_manager/level/level.hpp>
12 #include <ST_util/test_util.hpp>
13 #include <ST_util/string_util.hpp>
24 void SetUp()
override {
28 void TearDown()
override {
33 TEST_F(
level_tests, test_load_input_configuration) {
38 std::string key1 =
"INVENTORY";
39 uint16_t key1_hash = ST::hash_string(key1);
41 std::string key2 =
"GO";
42 uint16_t key2_hash = ST::hash_string(key2);
44 std::string key3 =
"JUMP";
45 uint16_t key3_hash = ST::hash_string(key3);
48 ASSERT_EQ(0, load_input_conf(&level));
49 ska::bytell_hash_map<uint16_t, std::vector<ST::key>> actions_buttons = level.actions_buttons;
51 ST::key check_key1 = actions_buttons.at(key1_hash).at(0);
52 ASSERT_EQ(ST::key::I, check_key1);
54 ST::key check_key2 = actions_buttons.at(key1_hash).at(1);
55 ASSERT_EQ(ST::key::CONTROLLER_BUTTON_B, check_key2);
57 ST::key check_key3 = actions_buttons.at(key2_hash).at(0);
58 ASSERT_EQ(ST::key::ENTER, check_key3);
60 ST::key check_key4 = actions_buttons.at(key3_hash).at(0);
61 ASSERT_EQ(ST::key::SPACEBAR, check_key4);
63 ST::key check_key5 = actions_buttons.at(key3_hash).at(1);
64 ASSERT_EQ(ST::key::CONTROLLER_BUTTON_A, check_key5);
68 int main(
int argc,
char **argv) {
69 ::testing::InitGoogleTest(&argc, argv);
70 return RUN_ALL_TESTS();
This object contains all the data for a level and provides functions for loading and unloading a leve...
Tests fixture for the level object.
The central messaging system of the engine. All subsystem make extensive use of it.