diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-08 19:49:41 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-08 19:49:41 +0100 |
commit | 519cc5d16e65ff501d330c03eeb35d2d095ead29 (patch) | |
tree | 3c7c3a64c922ec248f4136d1282530a6ec6647ac /src/test/Profiling.cpp | |
parent | 63bcd54e0e0ea64cfef5950568b4253d5dae5c1e (diff) |
made sdlcontext not a singleton anymore
Diffstat (limited to 'src/test/Profiling.cpp')
-rw-r--r-- | src/test/Profiling.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/test/Profiling.cpp b/src/test/Profiling.cpp index c753bca..46da378 100644 --- a/src/test/Profiling.cpp +++ b/src/test/Profiling.cpp @@ -1,4 +1,6 @@ +#include "facade/SDLContext.h" #include "manager/Mediator.h" +#include "manager/ResourceManager.h" #include "system/ParticleSystem.h" #include "system/PhysicsSystem.h" #include "system/RenderSystem.h" @@ -41,7 +43,7 @@ class TestScript : public Script { } }; -class DISABLED_ProfilingTest : public Test { +class ProfilingTest : public Test { public: // Config for test // Minimum amount to let test pass @@ -61,6 +63,8 @@ public: ParticleSystem particle_sys{m}; RenderSystem render_sys{m}; ScriptSystem script_sys{m}; + SDLContext ctx{m}; + ResourceManager resource_manager{m}; // Test data std::map<std::string, std::chrono::microseconds> timings; @@ -130,7 +134,7 @@ public: } }; -TEST_F(DISABLED_ProfilingTest, Profiling_1) { +TEST_F(ProfilingTest, Profiling_1) { while (this->total_time / this->average < this->duration) { { @@ -153,7 +157,7 @@ TEST_F(DISABLED_ProfilingTest, Profiling_1) { EXPECT_GE(this->game_object_count, this->min_gameobject_count); } -TEST_F(DISABLED_ProfilingTest, Profiling_2) { +TEST_F(ProfilingTest, Profiling_2) { while (this->total_time / this->average < this->duration) { { @@ -167,7 +171,7 @@ TEST_F(DISABLED_ProfilingTest, Profiling_2) { gameobject.add_component<BoxCollider>(vec2{0, 0}, vec2{1, 1}); gameobject.add_component<BehaviorScript>().set_script<TestScript>(); - auto img = Texture("asset/texture/square.png"); + auto img = Asset("asset/texture/square.png"); Sprite & test_sprite = gameobject.add_component<Sprite>( img, Sprite::Data{ .color = {0, 0, 0, 0}, @@ -192,7 +196,7 @@ TEST_F(DISABLED_ProfilingTest, Profiling_2) { EXPECT_GE(this->game_object_count, this->min_gameobject_count); } -TEST_F(DISABLED_ProfilingTest, Profiling_3) { +TEST_F(ProfilingTest, Profiling_3) { while (this->total_time / this->average < this->duration) { { @@ -205,7 +209,7 @@ TEST_F(DISABLED_ProfilingTest, Profiling_3) { }); gameobject.add_component<BoxCollider>(vec2{0, 0}, vec2{1, 1}); gameobject.add_component<BehaviorScript>().set_script<TestScript>(); - auto img = Texture("asset/texture/square.png"); + auto img = Asset("asset/texture/square.png"); Sprite & test_sprite = gameobject.add_component<Sprite>( img, Sprite::Data{ .color = {0, 0, 0, 0}, |