diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-06-29 17:31:56 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-06-29 18:35:50 +0200 |
commit | 17929a34430f526f01eb4ef29329d082643a6d03 (patch) | |
tree | 05c32c7386c1e04830e2648137991e2403200ed8 /tests/core/math/test_vector2.h | |
parent | 25de53e147a04ba15afc461b3ad4aa1884ff927d (diff) | |
download | redot-engine-17929a34430f526f01eb4ef29329d082643a6d03.tar.gz |
[Tests] Fix unit tests in template builds
Diffstat (limited to 'tests/core/math/test_vector2.h')
-rw-r--r-- | tests/core/math/test_vector2.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/core/math/test_vector2.h b/tests/core/math/test_vector2.h index fc3fd6a87d..7bd494ec80 100644 --- a/tests/core/math/test_vector2.h +++ b/tests/core/math/test_vector2.h @@ -353,7 +353,6 @@ TEST_CASE("[Vector2] Plane methods") { const Vector2 vector = Vector2(1.2, 3.4); const Vector2 vector_y = Vector2(0, 1); const Vector2 vector_normal = Vector2(0.95879811270838721622267, 0.2840883296913739899919); - const Vector2 vector_non_normal = Vector2(5.4, 1.6); const real_t p_d = 99.1; CHECK_MESSAGE( vector.bounce(vector_y) == Vector2(1.2, -3.4), @@ -383,6 +382,8 @@ TEST_CASE("[Vector2] Plane methods") { vector.slide(vector_normal).is_equal_approx(Vector2(-0.8292559899117276166456, 2.798738965952080706179)), "Vector2 slide with normal should return expected value."); // There's probably a better way to test these ones? +#ifdef MATH_CHECKS + const Vector2 vector_non_normal = Vector2(5.4, 1.6); ERR_PRINT_OFF; CHECK_MESSAGE( vector.bounce(vector_non_normal).is_equal_approx(Vector2()), @@ -394,6 +395,7 @@ TEST_CASE("[Vector2] Plane methods") { vector.slide(vector_non_normal).is_equal_approx(Vector2()), "Vector2 slide should return empty Vector2 with non-normalized input."); ERR_PRINT_ON; +#endif // MATH_CHECKS } TEST_CASE("[Vector2] Rounding methods") { |