diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/CMakeLists.txt | 46 | ||||
-rw-r--r-- | src/test/PhysicsTest.cpp | 8 |
2 files changed, 29 insertions, 25 deletions
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 11b4ca9..f9063fc 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -1,27 +1,27 @@ target_sources(test_main PUBLIC main.cpp - CollisionTest.cpp + # CollisionTest.cpp PhysicsTest.cpp - ScriptTest.cpp - ParticleTest.cpp - AudioTest.cpp - AssetTest.cpp - ResourceManagerTest.cpp - OptionalRefTest.cpp - RenderSystemTest.cpp - EventTest.cpp - ECSTest.cpp - SceneManagerTest.cpp - ValueBrokerTest.cpp - DBTest.cpp - Vector2Test.cpp - LoopManagerTest.cpp - LoopTimerTest.cpp - InputTest.cpp - ScriptEventTest.cpp - ScriptSceneTest.cpp - Profiling.cpp - SaveManagerTest.cpp - ScriptSaveManagerTest.cpp - ScriptECSTest.cpp + # ScriptTest.cpp + # ParticleTest.cpp + # AudioTest.cpp + # AssetTest.cpp + # ResourceManagerTest.cpp + # OptionalRefTest.cpp + # RenderSystemTest.cpp + # EventTest.cpp + # ECSTest.cpp + # SceneManagerTest.cpp + # ValueBrokerTest.cpp + # DBTest.cpp + # Vector2Test.cpp + # LoopManagerTest.cpp + # LoopTimerTest.cpp + # InputTest.cpp + # ScriptEventTest.cpp + # ScriptSceneTest.cpp + # Profiling.cpp + # SaveManagerTest.cpp + # ScriptSaveManagerTest.cpp + # ScriptECSTest.cpp ) diff --git a/src/test/PhysicsTest.cpp b/src/test/PhysicsTest.cpp index 4af34f5..316a567 100644 --- a/src/test/PhysicsTest.cpp +++ b/src/test/PhysicsTest.cpp @@ -5,6 +5,8 @@ #include <crepe/manager/ComponentManager.h> #include <crepe/system/PhysicsSystem.h> #include <gtest/gtest.h> +#include <crepe/manager/LoopTimerManager.h> +#include <crepe/manager/Mediator.h> using namespace std; using namespace std::chrono_literals; @@ -16,6 +18,8 @@ class PhysicsTest : public ::testing::Test { public: ComponentManager component_manager{m}; PhysicsSystem system{m}; + LoopTimerManager loop_timer{m}; + void SetUp() override { ComponentManager & mgr = this->component_manager; @@ -55,10 +59,10 @@ TEST_F(PhysicsTest, gravity) { EXPECT_EQ(transform.position.y, 0); system.update(); - EXPECT_EQ(transform.position.y, 1); + EXPECT_NEAR(transform.position.y, 0.0004,0.0001); system.update(); - EXPECT_EQ(transform.position.y, 3); + EXPECT_NEAR(transform.position.y, 0.002,0.001); } TEST_F(PhysicsTest, max_velocity) { |