added tests
authorLukel495 <lukas.eliasson@live.se>
Mon, 11 Dec 2023 10:11:06 +0000 (11:11 +0100)
committerLukel495 <lukas.eliasson@live.se>
Mon, 11 Dec 2023 10:11:06 +0000 (11:11 +0100)
src/_test.cc

index 5292fab7e19f00108ba090085c4571690e42ddb1..bcc4ffc34f1790e9232b7c0b8e38dabdf51c0f7e 100644 (file)
@@ -25,17 +25,23 @@ TEST_CASE("functions")
     {
         Context game_context{};
 
-        std::ifstream f("assets/data.json");
-        json data = json::parse(f);
-        game_context.current_state = std::make_unique<Start_menu>(data);
+        std::ifstream f("assets/data_test.json");
+        json test_data = json::parse(f);
+
+        game_context.current_state = std::make_unique<Start_menu>(test_data);
+
         sf::Texture helper_texture;
-        helper_texture.loadFromFile(data["game_state_assets"]["helper_file"]);
-        Helper helper {helper_texture, data["helper"]};
+        helper_texture.loadFromFile(test_data["game_state_assets"]["helper_file"]);
+        Helper helper {helper_texture, test_data["helper"]};
         CHECK(helper.get_hitbox().getPosition().x == 989.33502f);
         CHECK(helper.get_hitbox().getPosition().y == 37.94f);
         helper.update(game_context);
         CHECK_FALSE(helper.get_hitbox().getPosition().x == 1000);
         CHECK_FALSE(helper.get_hitbox().getPosition().y == 50);
+
+
+
+        
     }
 }