summaryrefslogtreecommitdiff
path: root/tests/scene/test_curve.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scene/test_curve.h')
-rw-r--r--tests/scene/test_curve.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/scene/test_curve.h b/tests/scene/test_curve.h
index 36ec0c0a4d..4f95568b4a 100644
--- a/tests/scene/test_curve.h
+++ b/tests/scene/test_curve.h
@@ -31,6 +31,7 @@
#ifndef TEST_CURVE_H
#define TEST_CURVE_H
+#include "core/math/math_funcs.h"
#include "scene/resources/curve.h"
#include "tests/test_macros.h"
@@ -229,7 +230,7 @@ TEST_CASE("[Curve2D] Linear sampling should return exact value") {
for (int i = 0; i < len; i++) {
Vector2 pos = curve->sample_baked(i);
- CHECK_MESSAGE(pos.x == i, "sample_baked should return exact value");
+ CHECK_MESSAGE(Math::is_equal_approx(pos.x, i), "sample_baked should return exact value");
}
}
@@ -239,13 +240,14 @@ TEST_CASE("[Curve3D] Linear sampling should return exact value") {
curve->add_point(Vector3(0, 0, 0));
curve->add_point(Vector3(len, 0, 0));
-
+ ERR_PRINT_OFF
real_t baked_length = curve->get_baked_length();
+ ERR_PRINT_ON
CHECK(len == baked_length);
for (int i = 0; i < len; i++) {
Vector3 pos = curve->sample_baked(i);
- CHECK_MESSAGE(pos.x == i, "sample_baked should return exact value");
+ CHECK_MESSAGE(Math::is_equal_approx(pos.x, i), "sample_baked should return exact value");
}
}