diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-05 18:06:25 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-05 18:06:25 +0100 |
commit | b5fd901b0711780a9d84f3e60df3d24b030185e7 (patch) | |
tree | cccf05bd7421532f42845e474344bb38c22c273c /tests/scene/test_curve.h | |
parent | fd5142769bae3b5d6d46e0119d06d875d227945a (diff) | |
parent | 91e9ad92f5f78dd1578df46205f028599f095357 (diff) |
Merge pull request #69115 from xiongyaohua/curve2d_baking_refactor
Curve2d baking and sampling refactor
Diffstat (limited to 'tests/scene/test_curve.h')
-rw-r--r-- | tests/scene/test_curve.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/scene/test_curve.h b/tests/scene/test_curve.h index 36ec0c0a4d..4afd5b293f 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"); } } @@ -245,7 +246,7 @@ TEST_CASE("[Curve3D] Linear sampling should return exact value") { 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"); } } |