aboutsummaryrefslogtreecommitdiff
path: root/src/test/PhysicsTest.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-11 21:32:05 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-11 21:32:05 +0100
commita4c65ca6a69987349f703e51beed47a219d3d92d (patch)
tree9d8ca1e5963f4be21896e8df6218b48117b17cbd /src/test/PhysicsTest.cpp
parent436b0db58c7533b286ecd3ec3d3c71311e71cf9c (diff)
timing fix
Diffstat (limited to 'src/test/PhysicsTest.cpp')
-rw-r--r--src/test/PhysicsTest.cpp8
1 files changed, 6 insertions, 2 deletions
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) {