aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/CMakeLists.txt24
-rw-r--r--src/test/PhysicsTest.cpp10
-rw-r--r--src/test/Profiling.cpp10
3 files changed, 17 insertions, 27 deletions
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 4555c0b..cd61fb7 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -1,17 +1,17 @@
target_sources(test_main PUBLIC
CollisionTest.cpp
main.cpp
- # PhysicsTest.cpp
- # ScriptTest.cpp
- # ParticleTest.cpp
- # AssetTest.cpp
- # OptionalRefTest.cpp
- # RenderSystemTest.cpp
- # EventTest.cpp
- # ECSTest.cpp
- # SceneManagerTest.cpp
- # ValueBrokerTest.cpp
- # DBTest.cpp
- # Vector2Test.cpp
+ PhysicsTest.cpp
+ ScriptTest.cpp
+ ParticleTest.cpp
+ AssetTest.cpp
+ OptionalRefTest.cpp
+ RenderSystemTest.cpp
+ EventTest.cpp
+ ECSTest.cpp
+ SceneManagerTest.cpp
+ ValueBrokerTest.cpp
+ DBTest.cpp
+ Vector2Test.cpp
Profiling.cpp
)
diff --git a/src/test/PhysicsTest.cpp b/src/test/PhysicsTest.cpp
index 33b6020..5dd448f 100644
--- a/src/test/PhysicsTest.cpp
+++ b/src/test/PhysicsTest.cpp
@@ -28,8 +28,6 @@ public:
.max_linear_velocity = vec2{10, 10},
.max_angular_velocity = 10,
.constraints = {0, 0},
- .use_gravity = true,
- .bounce = false,
});
}
transforms = mgr.get_components_by_id<Transform>(0);
@@ -105,16 +103,16 @@ TEST_F(PhysicsTest, movement) {
EXPECT_EQ(transform.position.y, 1);
EXPECT_EQ(transform.rotation, 1);
- rigidbody.data.linear_damping.x = 0.5;
- rigidbody.data.linear_damping.y = 0.5;
- rigidbody.data.angular_damping = 0.5;
+ rigidbody.data.linear_velocity_factor.x = 0.5;
+ rigidbody.data.linear_velocity_factor.y = 0.5;
+ rigidbody.data.angular_velocity_factor = 0.5;
system.update();
EXPECT_EQ(rigidbody.data.linear_velocity.x, 0.5);
EXPECT_EQ(rigidbody.data.linear_velocity.y, 0.5);
EXPECT_EQ(rigidbody.data.angular_velocity, 0.5);
rigidbody.data.constraints = {1, 1, 0};
- rigidbody.data.angular_damping = 0;
+ rigidbody.data.angular_velocity_factor = 0;
rigidbody.data.max_angular_velocity = 1000;
rigidbody.data.angular_velocity = 360;
system.update();
diff --git a/src/test/Profiling.cpp b/src/test/Profiling.cpp
index a88bf85..e46d5ff 100644
--- a/src/test/Profiling.cpp
+++ b/src/test/Profiling.cpp
@@ -26,14 +26,6 @@ using namespace std::chrono_literals;
using namespace crepe;
using namespace testing;
-
-/*
-List of test cases with component settings/details
-1. Minimal test creates gameobject without additonal components
-2. Minimal 'Complex' gameobject. Has dynamic body without bounce and no collision handler
-3. Minimal 'Complex' gameobject. Same as test 2 but with particle emitter
-*/
-
class TestScript : public Script {
bool oncollision(const CollisionEvent& test) {
Log::logf("Box {} script on_collision()", test.info.first_collider.game_object_id);
@@ -55,7 +47,7 @@ public:
// Minimum amount to let test pass
const int min_gameobject_count = 100;
// Maximum amount to stop test
- const int max_gameobject_count = 200;
+ const int max_gameobject_count = 150;
// Amount of times a test runs to calculate average
const int average = 5;
// Maximum duration to stop test