From 1954d06895a82b3b963aac5ae7cb450205119637 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 11 Dec 2024 16:48:16 +0100 Subject: fix tests --- src/test/InputTest.cpp | 1 + src/test/Profiling.cpp | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/test/InputTest.cpp b/src/test/InputTest.cpp index 73eaab3..4c05e56 100644 --- a/src/test/InputTest.cpp +++ b/src/test/InputTest.cpp @@ -24,6 +24,7 @@ class InputTest : public ::testing::Test { public: Mediator mediator; ComponentManager mgr{mediator}; + SDLContext sdl_context{mediator}; InputSystem input_system{mediator}; diff --git a/src/test/Profiling.cpp b/src/test/Profiling.cpp index 84272f6..9767cb9 100644 --- a/src/test/Profiling.cpp +++ b/src/test/Profiling.cpp @@ -1,8 +1,9 @@ -#include "api/Asset.h" -#include "manager/Mediator.h" -#include "system/ParticleSystem.h" -#include "system/PhysicsSystem.h" -#include "system/RenderSystem.h" +#include +#include +#include +#include +#include +#include #include #include #include @@ -55,6 +56,8 @@ public: const std::chrono::microseconds duration = 16000us; Mediator m; + SDLContext sdl_context{m}; + ResourceManager resman{m}; ComponentManager mgr{m}; // Add system used for profling tests CollisionSystem collision_sys{m}; @@ -168,9 +171,8 @@ TEST_F(DISABLED_ProfilingTest, Profiling_2) { gameobject.add_component(vec2{0, 0}, vec2{1, 1}); gameobject.add_component().set_script(); - auto img = Asset("asset/texture/square.png"); Sprite & test_sprite = gameobject.add_component( - img, Sprite::Data{ + Asset{"asset/texture/square.png"}, Sprite::Data{ .color = {0, 0, 0, 0}, .flip = {.flip_x = false, .flip_y = false}, .sorting_in_layer = 1, @@ -206,9 +208,8 @@ TEST_F(DISABLED_ProfilingTest, Profiling_3) { }); gameobject.add_component(vec2{0, 0}, vec2{1, 1}); gameobject.add_component().set_script(); - auto img = Asset("asset/texture/square.png"); Sprite & test_sprite = gameobject.add_component( - img, Sprite::Data{ + Asset{"asset/texture/square.png"}, Sprite::Data{ .color = {0, 0, 0, 0}, .flip = {.flip_x = false, .flip_y = false}, .sorting_in_layer = 1, -- cgit v1.2.3