Reenable unit tests in release mode

This commit is contained in:
SirLynix 2023-07-30 10:55:38 +02:00
parent 3d18052e45
commit b191dacc58
9 changed files with 20 additions and 24 deletions

View File

@ -79,7 +79,6 @@ jobs:
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration

View File

@ -72,7 +72,6 @@ jobs:
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration

View File

@ -102,7 +102,6 @@ jobs:
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration

View File

@ -73,7 +73,6 @@ jobs:
# Run unit tests
- name: Run unit tests
if: matrix.mode != 'releasedbg'
run: xmake run UnitTests
# Setup installation configuration

View File

@ -2,7 +2,7 @@
#include <catch2/catch_approx.hpp>
#include <catch2/catch_test_macros.hpp>
SCENARIO("Application", "[CORE][ABSTRACTHASH]")
SCENARIO("Application", "[CORE][Application]")
{
WHEN("Updating the application multiple times")
{

View File

@ -78,7 +78,7 @@ SCENARIO("Angle", "[MATH][ANGLE]")
THEN("It should be equivalent to a 2D rotation by this angle")
{
CHECK(quat == eulerAngles.ToQuaternion());
CHECK(quat.ApproxEqual(eulerAngles.ToQuaternion()));
}
}
}
@ -178,7 +178,7 @@ SCENARIO("Angle", "[MATH][ANGLE]")
THEN("It should be equivalent to a 2D rotation by this angle")
{
CHECK(quat == eulerAngles.ToQuaternion());
CHECK(quat.ApproxEqual(eulerAngles.ToQuaternion()));
}
}
}

View File

@ -58,9 +58,9 @@ SCENARIO("EulerAngles", "[MATH][EULERANGLES]")
Nz::Vector3f rotation90Y = euler90Y.ToQuaternion() * Nz::Vector3f::UnitZ();
Nz::Vector3f rotation90R = euler90R.ToQuaternion() * Nz::Vector3f::UnitX();
CHECK(rotation90P.ApproxEqual(Nz::Vector3f::UnitZ()));
CHECK(rotation90Y.ApproxEqual(Nz::Vector3f::UnitX()));
CHECK(rotation90R.ApproxEqual(Nz::Vector3f::UnitY()));
CHECK(rotation90P.ApproxEqual(Nz::Vector3f::UnitZ(), 0.0001f));
CHECK(rotation90Y.ApproxEqual(Nz::Vector3f::UnitX(), 0.0001f));
CHECK(rotation90R.ApproxEqual(Nz::Vector3f::UnitY(), 0.0001f));
}
}
}

View File

@ -109,10 +109,10 @@ SCENARIO("Matrix4", "[MATH][MATRIX4]")
0.f, -std::sqrt(2.f) / 2.f, std::sqrt(2.f) / 2.f, 0.f,
0.f, 0.f, 0.f, 1.f);
CHECK(transformedMatrix.ApproxEqual(rotation45X));
CHECK(transformedMatrix.ApproxEqual(rotation45X, 0.0001f));
transformedMatrix = Nz::Matrix4f::Transform(Nz::Vector3f::Unit(), Nz::EulerAnglesf(Nz::DegreeAnglef(45.f), 0.f, 0.f).ToQuaternion());
rotation45X.ApplyTranslation(Nz::Vector3f::Unit());
CHECK(transformedMatrix.ApproxEqual(rotation45X));
CHECK(transformedMatrix.ApproxEqual(rotation45X, 0.0001f));
}
THEN("Rotation around Y")
@ -140,7 +140,7 @@ SCENARIO("Matrix4", "[MATH][MATRIX4]")
CHECK(transformedMatrix.ApproxEqual(rotation45Z));
transformedMatrix = Nz::Matrix4f::Transform(Nz::Vector3f::Unit(), Nz::EulerAnglesf(Nz::EulerAnglesf(0.f, 0.f, Nz::DegreeAnglef(45.f)).ToQuaternion()));
rotation45Z.ApplyTranslation(Nz::Vector3f::Unit());
CHECK(transformedMatrix.ApproxEqual(rotation45Z));
CHECK(transformedMatrix.ApproxEqual(rotation45Z, 0.0001f));
}
}
}
@ -163,7 +163,7 @@ SCENARIO("Matrix4", "[MATH][MATRIX4]")
THEN("We should retrieve it")
{
REQUIRE(identity.GetRotation() == rotation);
REQUIRE(identity.GetRotation().ApproxEqual(rotation));
}
}
@ -174,7 +174,7 @@ SCENARIO("Matrix4", "[MATH][MATRIX4]")
THEN("We should retrieve it")
{
REQUIRE(identity.GetRotation() == rotation);
REQUIRE(identity.GetRotation().ApproxEqual(rotation));
}
}
@ -185,7 +185,7 @@ SCENARIO("Matrix4", "[MATH][MATRIX4]")
THEN("We should retrieve it")
{
REQUIRE(identity.GetRotation() == rotation);
REQUIRE(identity.GetRotation().ApproxEqual(rotation));
}
}

View File

@ -29,8 +29,8 @@ SCENARIO("Quaternion", "[MATH][QUATERNION]")
AND_THEN("Multiply with a vectorY or Z is opposite")
{
REQUIRE((firstQuaternion * Nz::Vector3f::UnitY()).ApproxEqual(-Nz::Vector3f::UnitY()));
REQUIRE((firstQuaternion * Nz::Vector3f::UnitZ()).ApproxEqual(-Nz::Vector3f::UnitZ()));
REQUIRE((firstQuaternion * Nz::Vector3f::UnitY()).ApproxEqual(-Nz::Vector3f::UnitY(), 0.0001f));
REQUIRE((firstQuaternion * Nz::Vector3f::UnitZ()).ApproxEqual(-Nz::Vector3f::UnitZ(), 0.0001f));
}
}
@ -121,9 +121,9 @@ SCENARIO("Quaternion", "[MATH][QUATERNION]")
THEN("They must be equal")
{
REQUIRE(X45 == Nz::Quaternionf(0.9238795f, 0.38268346f, 0.f, 0.f));
REQUIRE(Y45 == Nz::Quaternionf(0.9238795f, 0.f, 0.38268346f, 0.f));
REQUIRE(Z45 == Nz::Quaternionf(0.9238795f, 0.f, 0.f, 0.38268346f));
CHECK(X45.ApproxEqual(Nz::Quaternionf(0.9238795f, 0.38268346f, 0.f, 0.f)));
CHECK(Y45.ApproxEqual(Nz::Quaternionf(0.9238795f, 0.f, 0.38268346f, 0.f)));
CHECK(Z45.ApproxEqual(Nz::Quaternionf(0.9238795f, 0.f, 0.f, 0.38268346f)));
}
}
@ -229,9 +229,9 @@ SCENARIO("Quaternion", "[MATH][QUATERNION]")
CHECK(Nz::NumberEquals(rotation90Y.ToEulerAngles().yaw.ToDegrees(), 90.f, 0.1f));
CHECK(Nz::NumberEquals(rotation90Z.ToEulerAngles().roll.ToDegrees(), 90.f, 0.1f));
CHECK(rotation180X.ApproxEqual(Nz::EulerAnglesf(180.f, 0.f, 0.f)));
CHECK(rotation180Y.ApproxEqual(Nz::EulerAnglesf(0.f, 180.f, 0.f)));
CHECK(rotation180Z.ApproxEqual(Nz::EulerAnglesf(0.f, 0.f, 180.f)));
CHECK(rotation180X.ApproxEqual(Nz::EulerAnglesf(180.f, 0.f, 0.f), 0.0001f));
CHECK(rotation180Y.ApproxEqual(Nz::EulerAnglesf(0.f, 180.f, 0.f), 0.0001f));
CHECK(rotation180Z.ApproxEqual(Nz::EulerAnglesf(0.f, 0.f, 180.f), 0.0001f));
CHECK(Nz::NumberEquals(rotation270X.ToEulerAngles().pitch.ToDegrees(), -90.f, 0.1f));
CHECK(Nz::NumberEquals(rotation270Y.ToEulerAngles().yaw.ToDegrees(), -90.f, 0.1f));