From e624df32f06c42cd44db1bf822603d8749a38406 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 14 Sep 2023 20:13:30 +0200 Subject: more tests --- test/path-search.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/path-search.cpp b/test/path-search.cpp index ff09a5c9..d58e68b6 100644 --- a/test/path-search.cpp +++ b/test/path-search.cpp @@ -48,6 +48,22 @@ void test_bbox() fm_assert( is_passable(w, coord1, bbox({0, _15}, W)) ); } } + { + using enum rotation; + constexpr auto ch = chunk_coords_{11, 22, 0}; + auto w = world(); + auto& c = w[ch]; + c[{8, 7}].wall_north() = {metal2,0}; + c[{8, 9}].wall_north() = {metal2,0}; + fm_assert( is_passable_1(c, bbox({8, 8}, N)) ); + fm_assert( is_passable_1(c, bbox({8, 8}, E)) ); + fm_assert( !is_passable_1(c, bbox({8, 8}, S)) ); + fm_assert( is_passable_1(c, bbox({8, 8}, W)) ); + + c[{8, 8}].wall_north() = {metal2,0}; + c.mark_passability_modified(); + fm_assert( !is_passable_1(c, bbox({8, 8}, N)) ); + } // todo use test chunk } -- cgit v1.2.3