diff options
Diffstat (limited to 'tests/core')
-rw-r--r-- | tests/core/math/test_color.h | 6 | ||||
-rw-r--r-- | tests/core/math/test_vector2.h | 3 | ||||
-rw-r--r-- | tests/core/math/test_vector3.h | 3 | ||||
-rw-r--r-- | tests/core/object/test_class_db.h | 4 | ||||
-rw-r--r-- | tests/core/test_time.h | 3 |
5 files changed, 12 insertions, 7 deletions
diff --git a/tests/core/math/test_color.h b/tests/core/math/test_color.h index e62ce6ec60..702f17a9cf 100644 --- a/tests/core/math/test_color.h +++ b/tests/core/math/test_color.h @@ -146,15 +146,15 @@ TEST_CASE("[Color] Conversion methods") { TEST_CASE("[Color] Named colors") { CHECK_MESSAGE( - Color::named("red").is_equal_approx(Color(1, 0, 0)), + Color::named("red").is_equal_approx(Color::hex(0xFF0000FF)), "The named color \"red\" should match the expected value."); // Named colors have their names automatically normalized. CHECK_MESSAGE( - Color::named("white_smoke").is_equal_approx(Color(0.96, 0.96, 0.96)), + Color::named("white_smoke").is_equal_approx(Color::hex(0xF5F5F5FF)), "The named color \"white_smoke\" should match the expected value."); CHECK_MESSAGE( - Color::named("Slate Blue").is_equal_approx(Color(0.42, 0.35, 0.80)), + Color::named("Slate Blue").is_equal_approx(Color::hex(0x6A5ACDFF)), "The named color \"Slate Blue\" should match the expected value."); ERR_PRINT_OFF; diff --git a/tests/core/math/test_vector2.h b/tests/core/math/test_vector2.h index ff60467bf4..9b7800164a 100644 --- a/tests/core/math/test_vector2.h +++ b/tests/core/math/test_vector2.h @@ -90,6 +90,9 @@ TEST_CASE("[Vector2] Interpolation methods") { Vector2(5, 0).slerp(Vector2(0, 5), 0.5).is_equal_approx(Vector2(5, 5) * Math_SQRT12), "Vector2 slerp with non-normalized values should work as expected."); CHECK_MESSAGE( + Vector2(1, 1).slerp(Vector2(2, 2), 0.5).is_equal_approx(Vector2(1.5, 1.5)), + "Vector2 slerp with colinear inputs should behave as expected."); + CHECK_MESSAGE( Vector2().slerp(Vector2(), 0.5) == Vector2(), "Vector2 slerp with both inputs as zero vectors should return a zero vector."); CHECK_MESSAGE( diff --git a/tests/core/math/test_vector3.h b/tests/core/math/test_vector3.h index 847a7c0b3f..6f99fada2b 100644 --- a/tests/core/math/test_vector3.h +++ b/tests/core/math/test_vector3.h @@ -111,6 +111,9 @@ TEST_CASE("[Vector3] Interpolation methods") { Vector3(5, 0, 0).slerp(Vector3(0, 3, 4), 0.5).is_equal_approx(Vector3(3.535533905029296875, 2.121320486068725586, 2.828427314758300781)), "Vector3 slerp with non-normalized values should work as expected."); CHECK_MESSAGE( + Vector3(1, 1, 1).slerp(Vector3(2, 2, 2), 0.5).is_equal_approx(Vector3(1.5, 1.5, 1.5)), + "Vector3 slerp with colinear inputs should behave as expected."); + CHECK_MESSAGE( Vector3().slerp(Vector3(), 0.5) == Vector3(), "Vector3 slerp with both inputs as zero vectors should return a zero vector."); CHECK_MESSAGE( diff --git a/tests/core/object/test_class_db.h b/tests/core/object/test_class_db.h index e4145c8408..5cf5403a50 100644 --- a/tests/core/object/test_class_db.h +++ b/tests/core/object/test_class_db.h @@ -671,10 +671,6 @@ void add_exposed_classes(Context &r_context) { } else { exposed_class.methods.push_back(method); } - - if (method.is_virtual) { - TEST_COND(String(method.name)[0] != '_', "Virtual method ", String(method.name), " does not start with underscore."); - } } // Add signals diff --git a/tests/core/test_time.h b/tests/core/test_time.h index 903ca9c001..bc341c73bd 100644 --- a/tests/core/test_time.h +++ b/tests/core/test_time.h @@ -79,6 +79,9 @@ TEST_CASE("[Time] Unix time conversion to/from datetime string") { CHECK_MESSAGE(time->get_date_string_from_unix_time(1391904000) == "2014-02-09", "Time get_date_string_from_unix_time: The date for GODOT IS OPEN SOURCE without time is as expected."); CHECK_MESSAGE(time->get_time_string_from_unix_time(79830) == "22:10:30", "Time get_time_string_from_unix_time: The time for GODOT IS OPEN SOURCE without date is as expected."); CHECK_MESSAGE(time->get_datetime_string_from_unix_time(31494784780800) == "1000000-01-01T00:00:00", "Time get_datetime_string_from_unix_time: The timestamp for the year a million is as expected."); + CHECK_MESSAGE(time->get_offset_string_from_offset_minutes(0) == "+00:00", "Time get_offset_string_from_offset_minutes: The offset string is as expected."); + CHECK_MESSAGE(time->get_offset_string_from_offset_minutes(-600) == "-10:00", "Time get_offset_string_from_offset_minutes: The offset string is as expected."); + CHECK_MESSAGE(time->get_offset_string_from_offset_minutes(345) == "+05:45", "Time get_offset_string_from_offset_minutes: The offset string is as expected."); } TEST_CASE("[Time] Datetime dictionary conversion methods") { |