diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2021-02-25 09:54:50 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-06-11 10:53:20 -0400 |
commit | 554c776e08c9ee35fa9e2677e02f4005c11ddbc0 (patch) | |
tree | 1ea2b367e5cd59a8c9b049ceaeb0d6f4253f9aed /tests | |
parent | 6b0183ec893ddea3f8ae71005b5fce1ae988e8a0 (diff) |
Reformat structure string operators
The order of numbers is not changed except for Transform2D. All logic is done inside of their structures (and not in Variant).
For the number of decimals printed, they now use String::num_real which works best with real_t, except for Color which is fixed at 4 decimals (this is a reliable number of float digits when converting from 16-bpc so it seems like a good choice)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_aabb.h | 4 | ||||
-rw-r--r-- | tests/test_color.h | 2 | ||||
-rw-r--r-- | tests/test_rect2.h | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_aabb.h b/tests/test_aabb.h index 517c4dcefd..39e3c6e45b 100644 --- a/tests/test_aabb.h +++ b/tests/test_aabb.h @@ -50,8 +50,8 @@ TEST_CASE("[AABB] Constructor methods") { TEST_CASE("[AABB] String conversion") { CHECK_MESSAGE( - String(AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 5, 6))) == "-1.5, 2, -2.5 - 4, 5, 6", - "The string representation shouild match the expected value."); + String(AABB(Vector3(-1.5, 2, -2.5), Vector3(4, 5, 6))) == "[P: (-1.5, 2, -2.5), S: (4, 5, 6)]", + "The string representation should match the expected value."); } TEST_CASE("[AABB] Basic getters") { diff --git a/tests/test_color.h b/tests/test_color.h index ad4a7cd3f2..bffa890ae2 100644 --- a/tests/test_color.h +++ b/tests/test_color.h @@ -140,7 +140,7 @@ TEST_CASE("[Color] Conversion methods") { cyan.to_rgba64() == 0x0000'ffff'ffff'ffff, "The returned 64-bit BGR number should match the expected value."); CHECK_MESSAGE( - String(cyan) == "0, 1, 1, 1", + String(cyan) == "(0, 1, 1, 1)", "The string representation should match the expected value."); } diff --git a/tests/test_rect2.h b/tests/test_rect2.h index 821aa69970..c5740167db 100644 --- a/tests/test_rect2.h +++ b/tests/test_rect2.h @@ -61,7 +61,7 @@ TEST_CASE("[Rect2] Constructor methods") { TEST_CASE("[Rect2] String conversion") { // Note: This also depends on the Vector2 string representation. CHECK_MESSAGE( - String(Rect2(0, 100, 1280, 720)) == "0, 100, 1280, 720", + String(Rect2(0, 100, 1280, 720)) == "[P: (0, 100), S: (1280, 720)]", "The string representation should match the expected value."); } @@ -273,7 +273,7 @@ TEST_CASE("[Rect2i] Constructor methods") { TEST_CASE("[Rect2i] String conversion") { // Note: This also depends on the Vector2 string representation. CHECK_MESSAGE( - String(Rect2i(0, 100, 1280, 720)) == "0, 100, 1280, 720", + String(Rect2i(0, 100, 1280, 720)) == "[P: (0, 100), S: (1280, 720)]", "The string representation should match the expected value."); } |