aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-20 13:39:44 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-20 13:39:44 +0100
commitc6d7623cc0bc17aa171bc5078f2f36c15be28683 (patch)
tree29a377248db09c59b2c290eec9ea5d701a989592 /src/test
parent9836b2225d11b629349e7abd6afcc1e4d41aa4f9 (diff)
implemented feedback from @lonkaars
Diffstat (limited to 'src/test')
-rw-r--r--src/test/CMakeLists.txt2
-rw-r--r--src/test/RenderSystemTest.cpp (renamed from src/test/rendering.cpp)24
2 files changed, 13 insertions, 13 deletions
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 0969a52..1c93220 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -3,6 +3,6 @@ target_sources(test_main PUBLIC
PhysicsTest.cpp
ScriptTest.cpp
ParticleTest.cpp
- rendering.cpp
+ RenderSystemTest.cpp
)
diff --git a/src/test/rendering.cpp b/src/test/RenderSystemTest.cpp
index 4c5fb1d..ac479d3 100644
--- a/src/test/rendering.cpp
+++ b/src/test/RenderSystemTest.cpp
@@ -121,7 +121,7 @@ TEST_F(RenderSystemTest, sorting_sprites) {
}
TEST_F(RenderSystemTest, Update) {
- entity1.add_component<Camera>(Color::get_white());
+ entity1.add_component<Camera>(Color::WHITE);
{
vector<reference_wrapper<Sprite>> sprites = this->mgr.get_components_by_type<Sprite>();
ASSERT_EQ(sprites.size(), 4);
@@ -149,7 +149,7 @@ TEST_F(RenderSystemTest, Camera) {
EXPECT_NE(cameras.size(), 1);
}
{
- entity1.add_component<Camera>(Color::get_white());
+ entity1.add_component<Camera>(Color::WHITE);
auto cameras = this->mgr.get_components_by_type<Camera>();
EXPECT_EQ(cameras.size(), 1);
}
@@ -157,18 +157,18 @@ TEST_F(RenderSystemTest, Camera) {
//TODO improve with newer version
}
TEST_F(RenderSystemTest, Color) {
- entity1.add_component<Camera>(Color::get_white());
+ entity1.add_component<Camera>(Color::WHITE);
auto & sprite = this->mgr.get_components_by_id<Sprite>(entity1.id).front().get();
ASSERT_NE(sprite.sprite_image.get(), nullptr);
- sprite.color = Color::get_green();
- EXPECT_EQ(sprite.color.r, Color::get_green().r);
- EXPECT_EQ(sprite.color.g, Color::get_green().g);
- EXPECT_EQ(sprite.color.b, Color::get_green().b);
- EXPECT_EQ(sprite.color.a, Color::get_green().a);
+ sprite.color = Color::GREEN;
+ EXPECT_EQ(sprite.color.r, Color::GREEN.r);
+ EXPECT_EQ(sprite.color.g, Color::GREEN.g);
+ EXPECT_EQ(sprite.color.b, Color::GREEN.b);
+ EXPECT_EQ(sprite.color.a, Color::GREEN.a);
this->sys.update();
- EXPECT_EQ(sprite.color.r, Color::get_green().r);
- EXPECT_EQ(sprite.color.g, Color::get_green().g);
- EXPECT_EQ(sprite.color.b, Color::get_green().b);
- EXPECT_EQ(sprite.color.a, Color::get_green().a);
+ EXPECT_EQ(sprite.color.r, Color::GREEN.r);
+ EXPECT_EQ(sprite.color.g, Color::GREEN.g);
+ EXPECT_EQ(sprite.color.b, Color::GREEN.b);
+ EXPECT_EQ(sprite.color.a, Color::GREEN.a);
}