diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/math/test_aabb.h | 17 | ||||
-rw-r--r-- | tests/core/math/test_rect2.h | 16 | ||||
-rw-r--r-- | tests/core/math/test_rect2i.h | 16 | ||||
-rw-r--r-- | tests/scene/test_text_edit.h | 12 |
4 files changed, 33 insertions, 28 deletions
diff --git a/tests/core/math/test_aabb.h b/tests/core/math/test_aabb.h index 447420fc12..d5f54a139e 100644 --- a/tests/core/math/test_aabb.h +++ b/tests/core/math/test_aabb.h @@ -94,7 +94,7 @@ TEST_CASE("[AABB] Volume getters") { Math::is_equal_approx(aabb.get_volume(), 120), "get_volume() should return the expected value with positive size."); CHECK_MESSAGE( - !aabb.has_no_volume(), + aabb.has_volume(), "Non-empty volumetric AABB should have a volume."); aabb = AABB(Vector3(-1.5, 2, -2.5), Vector3(-4, 5, 6)); @@ -114,27 +114,32 @@ TEST_CASE("[AABB] Volume getters") { aabb = AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 0, 6)); CHECK_MESSAGE( - aabb.has_no_volume(), + !aabb.has_volume(), "Non-empty flat AABB should not have a volume."); CHECK_MESSAGE( - AABB().has_no_volume(), + !AABB().has_volume(), "Empty AABB should not have a volume."); } TEST_CASE("[AABB] Surface getters") { AABB aabb = AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 5, 6)); CHECK_MESSAGE( - !aabb.has_no_surface(), + aabb.has_surface(), "Non-empty volumetric AABB should have an surface."); aabb = AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 0, 6)); CHECK_MESSAGE( - !aabb.has_no_surface(), + aabb.has_surface(), "Non-empty flat AABB should have a surface."); + aabb = AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 0, 0)); CHECK_MESSAGE( - AABB().has_no_surface(), + aabb.has_surface(), + "Non-empty linear AABB should have a surface."); + + CHECK_MESSAGE( + !AABB().has_surface(), "Empty AABB should not have an surface."); } diff --git a/tests/core/math/test_rect2.h b/tests/core/math/test_rect2.h index 0b1106ac3c..6323b214db 100644 --- a/tests/core/math/test_rect2.h +++ b/tests/core/math/test_rect2.h @@ -118,17 +118,17 @@ TEST_CASE("[Rect2] Area getters") { "get_area() should return the expected value."); CHECK_MESSAGE( - !Rect2(0, 100, 1280, 720).has_no_area(), - "has_no_area() should return the expected value on Rect2 with an area."); + Rect2(0, 100, 1280, 720).has_area(), + "has_area() should return the expected value on Rect2 with an area."); CHECK_MESSAGE( - Rect2(0, 100, 0, 500).has_no_area(), - "has_no_area() should return the expected value on Rect2 with no area."); + !Rect2(0, 100, 0, 500).has_area(), + "has_area() should return the expected value on Rect2 with no area."); CHECK_MESSAGE( - Rect2(0, 100, 500, 0).has_no_area(), - "has_no_area() should return the expected value on Rect2 with no area."); + !Rect2(0, 100, 500, 0).has_area(), + "has_area() should return the expected value on Rect2 with no area."); CHECK_MESSAGE( - Rect2(0, 100, 0, 0).has_no_area(), - "has_no_area() should return the expected value on Rect2 with no area."); + !Rect2(0, 100, 0, 0).has_area(), + "has_area() should return the expected value on Rect2 with no area."); } TEST_CASE("[Rect2] Absolute coordinates") { diff --git a/tests/core/math/test_rect2i.h b/tests/core/math/test_rect2i.h index 0d1a088a66..4005300e1f 100644 --- a/tests/core/math/test_rect2i.h +++ b/tests/core/math/test_rect2i.h @@ -118,17 +118,17 @@ TEST_CASE("[Rect2i] Area getters") { "get_area() should return the expected value."); CHECK_MESSAGE( - !Rect2i(0, 100, 1280, 720).has_no_area(), - "has_no_area() should return the expected value on Rect2i with an area."); + Rect2i(0, 100, 1280, 720).has_area(), + "has_area() should return the expected value on Rect2i with an area."); CHECK_MESSAGE( - Rect2i(0, 100, 0, 500).has_no_area(), - "has_no_area() should return the expected value on Rect2i with no area."); + !Rect2i(0, 100, 0, 500).has_area(), + "has_area() should return the expected value on Rect2i with no area."); CHECK_MESSAGE( - Rect2i(0, 100, 500, 0).has_no_area(), - "has_no_area() should return the expected value on Rect2i with no area."); + !Rect2i(0, 100, 500, 0).has_area(), + "has_area() should return the expected value on Rect2i with no area."); CHECK_MESSAGE( - Rect2i(0, 100, 0, 0).has_no_area(), - "has_no_area() should return the expected value on Rect2i with no area."); + !Rect2i(0, 100, 0, 0).has_area(), + "has_area() should return the expected value on Rect2i with no area."); } TEST_CASE("[Rect2i] Absolute coordinates") { diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h index 7550c12a0f..f0e6b98427 100644 --- a/tests/scene/test_text_edit.h +++ b/tests/scene/test_text_edit.h @@ -2714,15 +2714,15 @@ TEST_CASE("[SceneTree][TextEdit] caret") { text_edit->set_caret_blink_enabled(true); CHECK(text_edit->is_caret_blink_enabled()); - text_edit->set_caret_blink_speed(10); - CHECK(text_edit->get_caret_blink_speed() == 10); + text_edit->set_caret_blink_interval(10); + CHECK(text_edit->get_caret_blink_interval() == 10); ERR_PRINT_OFF; - text_edit->set_caret_blink_speed(-1); - CHECK(text_edit->get_caret_blink_speed() == 10); + text_edit->set_caret_blink_interval(-1); + CHECK(text_edit->get_caret_blink_interval() == 10); - text_edit->set_caret_blink_speed(0); - CHECK(text_edit->get_caret_blink_speed() == 10); + text_edit->set_caret_blink_interval(0); + CHECK(text_edit->get_caret_blink_interval() == 10); ERR_PRINT_ON; text_edit->set_caret_type(TextEdit::CaretType::CARET_TYPE_LINE); |