diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-21 21:30:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 21:30:30 +0200 |
commit | ba57252bd8d7928c29e818b1ccf557e279c33ca0 (patch) | |
tree | 6b037a4a0b8b6907d571b1b847ed6ab3bc7507c3 /tests | |
parent | 726b826b310900ff475122ed65934d2499b8db4d (diff) | |
parent | 90908cd67d3f44ba70cc4b7b32f024ce508cc0ee (diff) |
Merge pull request #52878 from AnilBK/add-get-center
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") { |