diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_aabb.h | 3 | ||||
-rw-r--r-- | tests/test_rect2.h | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_aabb.h b/tests/test_aabb.h index c4daa56e5a..2724d9481a 100644 --- a/tests/test_aabb.h +++ b/tests/test_aabb.h @@ -65,6 +65,9 @@ TEST_CASE("[AABB] Basic getters") { CHECK_MESSAGE( aabb.get_end().is_equal_approx(Vector3(2.5, 7, 3.5)), "get_end() should return the expected value."); + CHECK_MESSAGE( + aabb.get_center().is_equal_approx(Vector3(0.5, 4.5, 0.5)), + "get_center() should return the expected value."); } TEST_CASE("[AABB] Basic setters") { diff --git a/tests/test_rect2.h b/tests/test_rect2.h index c5740167db..3d9fe5a32e 100644 --- a/tests/test_rect2.h +++ b/tests/test_rect2.h @@ -76,6 +76,12 @@ TEST_CASE("[Rect2] Basic getters") { CHECK_MESSAGE( rect.get_end().is_equal_approx(Vector2(1280, 820)), "get_end() should return the expected value."); + CHECK_MESSAGE( + rect.get_center().is_equal_approx(Vector2(640, 460)), + "get_center() should return the expected value."); + CHECK_MESSAGE( + Rect2(0, 100, 1281, 721).get_center().is_equal_approx(Vector2(640.5, 460.5)), + "get_center() should return the expected value."); } TEST_CASE("[Rect2] Basic setters") { @@ -288,6 +294,12 @@ TEST_CASE("[Rect2i] Basic getters") { CHECK_MESSAGE( rect.get_end() == Vector2i(1280, 820), "get_end() should return the expected value."); + CHECK_MESSAGE( + rect.get_center() == Vector2i(640, 460), + "get_center() should return the expected value."); + CHECK_MESSAGE( + Rect2i(0, 100, 1281, 721).get_center() == Vector2i(640, 460), + "get_center() should return the expected value."); } TEST_CASE("[Rect2i] Basic setters") { |