diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-12 15:39:22 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-12 15:39:22 +0200 |
commit | ded20797c675228ff3d5c0bbc1e5f370e7f157b1 (patch) | |
tree | e88c9c52fddbc4764f7a311fc471dc9137b9cd62 | |
parent | 9ecb01be6cf0009e2a802e42519a15835db18807 (diff) |
a
-rw-r--r-- | test/path-search.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/test/path-search.cpp b/test/path-search.cpp index 3a78489f..bf0fa69b 100644 --- a/test/path-search.cpp +++ b/test/path-search.cpp @@ -3,7 +3,6 @@ #include "loader/loader.hpp" #include "src/world.hpp" #include "src/scenery.hpp" - #include "src/path-search.hpp" namespace floormat { @@ -28,21 +27,25 @@ void test_bbox() const auto table = loader.scenery("table1"); { + constexpr auto coord1 = chunk_coords_{1, 1, 0}, + coord2 = chunk_coords_{1, 2, 0}; using enum rotation; - auto w = world(); - [[maybe_unused]] auto& c12 = w[chunk_coords_{1, 2, 0}]; - [[maybe_unused]] auto& c11 = w[chunk_coords_{1, 1, 0}]; - c12[{0, 0}].wall_north() = {metal2, 0}; - - fm_assert( sample2(w, chunk_coords_{1, 1, 0}, bbox({0, TILE_MAX_DIM-1}, W)) ); - fm_assert( sample2(w, chunk_coords_{1, 1, 0}, bbox({0, TILE_MAX_DIM-1}, E)) ); - fm_assert( sample2(w, chunk_coords_{1, 1, 0}, bbox({0, TILE_MAX_DIM-1}, N)) ); - fm_assert( !sample2(w, chunk_coords_{1, 1, 0}, bbox({0, TILE_MAX_DIM-1}, S)) ); - - fm_assert( !sample(c12, bbox({0, 0}, N)) ); - fm_assert( sample(c12, bbox({0, 0}, E)) ); - fm_assert( sample(c12, bbox({0, 0}, S)) ); - fm_assert( sample(c12, bbox({0, 0}, W)) ); + { + auto w = world(); + [[maybe_unused]] auto& c12 = w[coord2]; + [[maybe_unused]] auto& c11 = w[coord1]; + c12[{0, 0}].wall_north() = {metal2, 0}; + + fm_assert( !sample(c12, bbox({0, 0}, N)) ); + fm_assert( sample(c12, bbox({0, 0}, E)) ); + fm_assert( sample(c12, bbox({0, 0}, S)) ); + fm_assert( sample(c12, bbox({0, 0}, W)) ); + + fm_assert( sample2(w, coord1, bbox({0, TILE_MAX_DIM-1}, N)) ); + fm_assert( sample2(w, coord1, bbox({0, TILE_MAX_DIM-1}, E)) ); + fm_assert( !sample2(w, coord1, bbox({0, TILE_MAX_DIM-1}, S)) ); + fm_assert( sample2(w, coord1, bbox({0, TILE_MAX_DIM-1}, W)) ); + } } // todo use test chunk } |