From c9906cdf31edb5742f91680f11e06cfacea6679e Mon Sep 17 00:00:00 2001 From: Lukel495 Date: Mon, 11 Dec 2023 10:37:38 +0100 Subject: [PATCH] added some testcases: Malin Stina ALMA Lukas NIls Arvid --- src/_test.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/_test.cc b/src/_test.cc index 4ed1579..5292fab 100644 --- a/src/_test.cc +++ b/src/_test.cc @@ -15,6 +15,7 @@ #include "json.hpp" #include "constants.h" #include "Context.h" +#include "Helper.h" using json = nlohmann::json; @@ -27,8 +28,14 @@ TEST_CASE("functions") std::ifstream f("assets/data.json"); json data = json::parse(f); game_context.current_state = std::make_unique(data); - - std::cout << "banenrr" << std::endl; + sf::Texture helper_texture; + helper_texture.loadFromFile(data["game_state_assets"]["helper_file"]); + Helper helper {helper_texture, 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); } } -- 2.30.2