From 97cdb110aef5bb75ba225a795d30f3534472e239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Wed, 5 Sep 2018 15:15:26 +0200 Subject: [PATCH] Unit test fixes --- tests/Engine/Physics2D/RigidBody2D.cpp | 4 ++-- tests/SDK/NDK/Systems/PhysicsSystem2D.cpp | 2 +- tests/SDK/NDK/Systems/RenderSystem.cpp | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/Engine/Physics2D/RigidBody2D.cpp b/tests/Engine/Physics2D/RigidBody2D.cpp index 0da831cfc..e801cc849 100644 --- a/tests/Engine/Physics2D/RigidBody2D.cpp +++ b/tests/Engine/Physics2D/RigidBody2D.cpp @@ -126,7 +126,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") { CHECK(body.GetAABB() == aabb); CHECK(body.GetAngularVelocity() == Approx(0.f)); - CHECK(body.GetCenterOfGravity() == Nz::Vector2f::Zero()); + CHECK(body.GetMassCenter() == Nz::Vector2f::Zero()); CHECK(body.GetGeom() == box); CHECK(body.GetMass() == Approx(mass)); CHECK(body.GetPosition() == position); @@ -150,7 +150,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]") { aabb.Translate(velocity); CHECK(body.GetAABB() == aabb); - CHECK(body.GetCenterOfGravity() == Nz::Vector2f::Zero()); + CHECK(body.GetMassCenter() == Nz::Vector2f::Zero()); CHECK(body.GetPosition() == position); CHECK(body.GetVelocity() == velocity); } diff --git a/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp b/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp index 3cda3f0f1..33871be57 100644 --- a/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp +++ b/tests/SDK/NDK/Systems/PhysicsSystem2D.cpp @@ -38,7 +38,7 @@ SCENARIO("PhysicsSystem2D", "[NDK][PHYSICSSYSTEM2D]") WHEN("We make it collide with a wall") { int rawDistance = 3; - Nz::Vector2f distance(rawDistance, 0.f); + Nz::Vector2f distance(float(rawDistance), 0.f); Nz::Vector2f wallPosition = position + Nz::Vector2f(movingAABB.width, 0.f) + distance; Nz::Rectf wallAABB(0.f, 0.f, 100.f, 100.f); Ndk::EntityHandle wallEntity = CreateBaseEntity(world, wallPosition, wallAABB); diff --git a/tests/SDK/NDK/Systems/RenderSystem.cpp b/tests/SDK/NDK/Systems/RenderSystem.cpp index a94109b9d..09fb6add2 100644 --- a/tests/SDK/NDK/Systems/RenderSystem.cpp +++ b/tests/SDK/NDK/Systems/RenderSystem.cpp @@ -6,7 +6,7 @@ #include #include -void CompareAABB(const Nz::Rectf& aabb, const Nz::BoundingVolumef& boundingVolume); +void CompareAABB(const Nz::Rectf& aabb, const Nz::Boxf& box); SCENARIO("RenderSystem", "[NDK][RenderSystem]") { @@ -110,9 +110,8 @@ SCENARIO("RenderSystem", "[NDK][RenderSystem]") } } -void CompareAABB(const Nz::Rectf& aabb, const Nz::BoundingVolumef& boundingVolume) +void CompareAABB(const Nz::Rectf& aabb, const Nz::Boxf& box) { - Nz::Boxf box = boundingVolume.aabb; CHECK(aabb.x == Approx(box.x)); CHECK(aabb.y == Approx(box.y)); CHECK(aabb.width == Approx(box.width));