Fix unit tests

This commit is contained in:
Lynix
2018-02-12 20:18:51 +01:00
parent 45af15d802
commit 9bfcd02730
2 changed files with 13 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
#include <Nazara/Physics2D/RigidBody2D.hpp>
#include <Nazara/Physics2D/PhysWorld2D.hpp>
#include <Catch/catch.hpp>
#include <limits>
Nz::RigidBody2D CreateBody(Nz::PhysWorld2D& world);
void EQUALITY(const Nz::RigidBody2D& left, const Nz::RigidBody2D& right);
@@ -11,6 +12,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
GIVEN("A physic world and a rigid body")
{
Nz::PhysWorld2D world;
world.SetMaxStepCount(std::numeric_limits<std::size_t>::max());
Nz::Vector2f positionAABB(3.f, 4.f);
Nz::Rectf aabb(positionAABB.x, positionAABB.y, 1.f, 2.f);
@@ -82,6 +84,8 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
GIVEN("A physic world")
{
Nz::PhysWorld2D world;
world.SetMaxStepCount(std::numeric_limits<std::size_t>::max());
Nz::Rectf aabb(3.f, 4.f, 1.f, 2.f);
WHEN("We get a rigid body from a function")
@@ -102,6 +106,8 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
GIVEN("A physic world and a rigid body")
{
Nz::PhysWorld2D world;
world.SetMaxStepCount(std::numeric_limits<std::size_t>::max());
Nz::Vector2f positionAABB(3.f, 4.f);
Nz::Rectf aabb(positionAABB.x, positionAABB.y, 1.f, 2.f);
Nz::Collider2DRef box = Nz::BoxCollider2D::New(aabb);
@@ -200,6 +206,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
GIVEN("A physic world and a rigid body of circle")
{
Nz::PhysWorld2D world;
world.SetMaxStepCount(std::numeric_limits<std::size_t>::max());
Nz::Vector2f position(3.f, 4.f);
float radius = 5.f;
@@ -221,6 +228,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
GIVEN("A physic world and a rigid body of compound")
{
Nz::PhysWorld2D world;
world.SetMaxStepCount(std::numeric_limits<std::size_t>::max());
Nz::Rectf aabb(0.f, 0.f, 1.f, 1.f);
Nz::BoxCollider2DRef box1 = Nz::BoxCollider2D::New(aabb);
@@ -249,6 +257,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
GIVEN("A physic world and a rigid body of circle")
{
Nz::PhysWorld2D world;
world.SetMaxStepCount(std::numeric_limits<std::size_t>::max());
std::vector<Nz::Vector2f> vertices;
vertices.push_back(Nz::Vector2f(0.f, 0.f));
@@ -275,6 +284,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
GIVEN("A physic world and a rigid body of segment")
{
Nz::PhysWorld2D world;
world.SetMaxStepCount(std::numeric_limits<std::size_t>::max());
Nz::Vector2f positionA(3.f, 4.f);
Nz::Vector2f positionB(1.f, -4.f);