aboutsummaryrefslogtreecommitdiff
path: root/src/test/PhysicsTest.cpp
diff options
context:
space:
mode:
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) {