diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 45670c227..acf6cd3a0 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -79,7 +79,6 @@ jobs: # Run unit tests - name: Run unit tests - if: matrix.mode != 'releasedbg' run: xmake run UnitTests # Setup installation configuration diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 238c43561..4636e824a 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -72,7 +72,6 @@ jobs: # Run unit tests - name: Run unit tests - if: matrix.mode != 'releasedbg' run: xmake run UnitTests # Setup installation configuration diff --git a/.github/workflows/msys2-build.yml b/.github/workflows/msys2-build.yml index 88010f46a..ac64d38e1 100644 --- a/.github/workflows/msys2-build.yml +++ b/.github/workflows/msys2-build.yml @@ -102,7 +102,6 @@ jobs: # Run unit tests - name: Run unit tests - if: matrix.mode != 'releasedbg' run: xmake run UnitTests # Setup installation configuration diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index c18eed854..bb7a28cbf 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -73,7 +73,6 @@ jobs: # Run unit tests - name: Run unit tests - if: matrix.mode != 'releasedbg' run: xmake run UnitTests # Setup installation configuration diff --git a/tests/UnitTests/Engine/Core/ApplicationTest.cpp b/tests/UnitTests/Engine/Core/ApplicationTest.cpp index be4cceb99..6f002dacf 100644 --- a/tests/UnitTests/Engine/Core/ApplicationTest.cpp +++ b/tests/UnitTests/Engine/Core/ApplicationTest.cpp @@ -2,7 +2,7 @@ #include #include -SCENARIO("Application", "[CORE][ABSTRACTHASH]") +SCENARIO("Application", "[CORE][Application]") { WHEN("Updating the application multiple times") { diff --git a/tests/UnitTests/Engine/Math/AngleTest.cpp b/tests/UnitTests/Engine/Math/AngleTest.cpp index b246cfd7d..8ced83347 100644 --- a/tests/UnitTests/Engine/Math/AngleTest.cpp +++ b/tests/UnitTests/Engine/Math/AngleTest.cpp @@ -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())); } } } diff --git a/tests/UnitTests/Engine/Math/EulerAnglesTest.cpp b/tests/UnitTests/Engine/Math/EulerAnglesTest.cpp index 886eae930..157049b70 100644 --- a/tests/UnitTests/Engine/Math/EulerAnglesTest.cpp +++ b/tests/UnitTests/Engine/Math/EulerAnglesTest.cpp @@ -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)); } } } diff --git a/tests/UnitTests/Engine/Math/Matrix4Test.cpp b/tests/UnitTests/Engine/Math/Matrix4Test.cpp index 012d20c06..24948200f 100644 --- a/tests/UnitTests/Engine/Math/Matrix4Test.cpp +++ b/tests/UnitTests/Engine/Math/Matrix4Test.cpp @@ -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)); } } diff --git a/tests/UnitTests/Engine/Math/QuaternionTest.cpp b/tests/UnitTests/Engine/Math/QuaternionTest.cpp index 45f50c9b9..766ec674a 100644 --- a/tests/UnitTests/Engine/Math/QuaternionTest.cpp +++ b/tests/UnitTests/Engine/Math/QuaternionTest.cpp @@ -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));