summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-01-31 17:55:48 +0100
committerMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2022-01-31 19:03:57 +0100
commit23a4fe5b27c191eae1dde05aa522463e67b0766f (patch)
tree5985555fe3cbe32d42ec1955f638c615cb157d70 /tests
parentd7822cbf2136b5dcff899b498c80c139b7701c9e (diff)
Fix incorrect Rect2i calculations: intersects and encloses
Clarify expand documentation
Diffstat (limited to 'tests')
-rw-r--r--tests/core/math/test_rect2.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/core/math/test_rect2.h b/tests/core/math/test_rect2.h
index e07250a8a2..d98a94b1b5 100644
--- a/tests/core/math/test_rect2.h
+++ b/tests/core/math/test_rect2.h
@@ -439,6 +439,9 @@ TEST_CASE("[Rect2i] Enclosing") {
CHECK_MESSAGE(
!Rect2i(0, 100, 1280, 720).encloses(Rect2i(-4000, -4000, 100, 100)),
"encloses() with non-contained Rect2i should return the expected result.");
+ CHECK_MESSAGE(
+ Rect2i(0, 100, 1280, 720).encloses(Rect2i(0, 100, 1280, 720)),
+ "encloses() with identical Rect2i should return the expected result.");
}
TEST_CASE("[Rect2i] Expanding") {
@@ -557,6 +560,9 @@ TEST_CASE("[Rect2i] Intersection") {
CHECK_MESSAGE(
!Rect2i(0, 100, 1280, 720).intersects(Rect2i(-4000, -4000, 100, 100)),
"intersects() with non-enclosed Rect2i should return the expected result.");
+ CHECK_MESSAGE(
+ !Rect2i(0, 0, 2, 2).intersects(Rect2i(2, 2, 2, 2)),
+ "intersects() with adjacent Rect2i should return the expected result.");
}
TEST_CASE("[Rect2i] Merging") {