diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/coords.cpp | 17 | ||||
-rw-r--r-- | test/main.cpp | 4 |
2 files changed, 13 insertions, 8 deletions
diff --git a/test/coords.cpp b/test/coords.cpp index f673e7cd..62f86fc5 100644 --- a/test/coords.cpp +++ b/test/coords.cpp @@ -9,13 +9,16 @@ constexpr auto norm = [](const point& pt, Vector2i delta) { return object::norma void test_normalize_point() { - auto a = point{{{ 0, 0, 0}, { 0, 0}}, { 0, 0} }, - b = point{{{ 0, -1, 0}, {15, 15}}, { 0, 0} }, - c = point{{{-1, 1, 1}, { 0, 0}}, { 1, 31} }, - d = point{{{ 1, 0, 1}, {15, 15}}, {-31, 31} }, - e = point{{{ 1, 0, 1}, {15, 15}}, {-31, 31} }; - - fm_assert_equal(norm(a, {}), point{{{ 0, 0, 0}, { 0, 0}}, { 0, 0} }); + auto a = point{{{ 0, 0, 0}, { 0, 0}}, { 0, 0} }, + b = point{{{ -1, 1, 0}, { 0, 15}}, { 0, 0} }, + c = point{{{ -1, 1, 1}, { 0, 0}}, { 1, 31} }, + d = point{{{ 1, 0, 1}, {15, 15}}, {-31, 31} }, + e = point{{{ 1, 0, 1}, {15, 15}}, {-31, 31} }, + f = point{{{16384, -16384, 2}, {15, 0}}, {1, 2} }; + + fm_assert_equal(norm(a, {}), point{{{ 0, 0, 0}, { 0, 0}}, { 0, 0} }); + fm_assert_equal(norm(b, { 1, -1}), point{{{ -1, 1 , 0}, { 0, 15}}, { 1, -1} }); + fm_assert_equal(norm(b, { -65, 65}), point{{{ -2, 2, 0}, {15, 0}}, { -1, 1} }); } } // namespace diff --git a/test/main.cpp b/test/main.cpp index 7855a87a..af64dfec 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -33,8 +33,10 @@ int test_app::exec() test_math(); test_hash(); test_path_search_node_pool(); - test_dijkstra(); test_coords(); + + test_dijkstra(); + zzz_test_misc(); return 0; |