From 75ca0750dcc07b6ca043320397917e33638e97b4 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Fri, 6 Dec 2024 19:54:16 +0100 Subject: fixed tests --- src/test/RenderSystemTest.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/test/RenderSystemTest.cpp') diff --git a/src/test/RenderSystemTest.cpp b/src/test/RenderSystemTest.cpp index 4868ddd..205f534 100644 --- a/src/test/RenderSystemTest.cpp +++ b/src/test/RenderSystemTest.cpp @@ -1,3 +1,4 @@ +#include "types.h" #include #include #include @@ -141,10 +142,8 @@ TEST_F(RenderSystemTest, sorting_sprites) { } TEST_F(RenderSystemTest, Update) { - entity1.add_component(Camera::Data{.bg_color = Color::WHITE, - .screen = ivec2{1080, 720}, - .viewport_size = vec2{2000, 2000}, - .zoom = 1.0f}); + entity1.add_component(ivec2{100, 100}, vec2{100, 100}, + Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); { vector> sprites = this->mgr.get_components_by_type(); ASSERT_EQ(sprites.size(), 4); @@ -172,10 +171,9 @@ TEST_F(RenderSystemTest, Camera) { EXPECT_NE(cameras.size(), 1); } { - entity1.add_component(Camera::Data{.bg_color = Color::WHITE, - .screen = ivec2{1080, 720}, - .viewport_size = vec2{2000, 2000}, - .zoom = 1.0f}); + entity1.add_component(ivec2{100, 100}, vec2{100, 100}, + Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); + auto cameras = this->mgr.get_components_by_type(); EXPECT_EQ(cameras.size(), 1); } @@ -183,10 +181,9 @@ TEST_F(RenderSystemTest, Camera) { //TODO improve with newer version } TEST_F(RenderSystemTest, Color) { - entity1.add_component(Camera::Data{.bg_color = Color::WHITE, - .screen = ivec2{1080, 720}, - .viewport_size = vec2{2000, 2000}, - .zoom = 1.0f}); + entity1.add_component(ivec2{100, 100}, vec2{100, 100}, + Camera::Data{.bg_color = Color::WHITE, .zoom = 1.0f}); + auto & sprite = this->mgr.get_components_by_id(entity1.id).front().get(); ASSERT_NE(sprite.texture.texture.get(), nullptr); -- cgit v1.2.3