summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/dijkstra.cpp2
-rw-r--r--test/loader.cpp3
-rw-r--r--test/main.cpp3
-rw-r--r--test/path-search.cpp2
-rw-r--r--test/serializer.cpp4
-rw-r--r--test/wall-atlas2.cpp14
6 files changed, 19 insertions, 9 deletions
diff --git a/test/dijkstra.cpp b/test/dijkstra.cpp
index 58a38afb..f3c47288 100644
--- a/test/dijkstra.cpp
+++ b/test/dijkstra.cpp
@@ -19,7 +19,7 @@ void test_app::test_dijkstra()
constexpr auto wpos = global_coords{wch, wt};
auto& ch = w[wch];
- auto metal2 = tile_image_proto{loader.tile_atlas("metal2", {2, 2}, pass_mode::blocked), 0};
+ auto metal2 = wall_image_proto{loader.wall_atlas("concrete1", false), 0};
for (int16_t j = wcy - 1; j <= wcy + 1; j++)
for (int16_t i = wcx - 1; i <= wcx + 1; i++)
diff --git a/test/loader.cpp b/test/loader.cpp
index 1ef5dac8..b45d4f0e 100644
--- a/test/loader.cpp
+++ b/test/loader.cpp
@@ -8,8 +8,7 @@ namespace floormat {
void test_app::test_loader()
{
- (void)loader.tile_atlases("wall.json", pass_mode::blocked);
- (void)loader.tile_atlases("floor.json", pass_mode::pass);
+ (void)loader.tile_atlases("floor.json");
fm_assert(loader.tile_atlas("texel")->pass_mode() == pass_mode::blocked);
fm_assert(loader.tile_atlas("metal1")->pass_mode() == pass_mode::pass);
loader.sceneries();
diff --git a/test/main.cpp b/test/main.cpp
index a5a96c54..973609f6 100644
--- a/test/main.cpp
+++ b/test/main.cpp
@@ -33,9 +33,8 @@ int test_app::exec()
test_math();
test_hash();
test_wall_atlas();
- test_wall_atlas2();
-
test_scenery();
+ test_wall_atlas2();
test_path_search_node_pool();
test_path_search();
test_dijkstra();
diff --git a/test/path-search.cpp b/test/path-search.cpp
index e42364e7..00203035 100644
--- a/test/path-search.cpp
+++ b/test/path-search.cpp
@@ -170,7 +170,7 @@ void test_bbox()
return neighbor_tiles(w, { ch, pos }, {}, (object_id)-1, path_search::never_continue());
};
- const auto metal2 = loader.tile_atlas("metal2", {2, 2}, pass_mode::blocked);
+ const auto metal2 = loader.wall_atlas("concrete1", false);
const auto table = loader.scenery("table1");
{
diff --git a/test/serializer.cpp b/test/serializer.cpp
index 5fd55b3e..9ef3b021 100644
--- a/test/serializer.cpp
+++ b/test/serializer.cpp
@@ -17,8 +17,8 @@ chunk& test_app::make_test_chunk(world& w, chunk_coords_ ch)
{
chunk& c = w[ch];
c.mark_modified();
- auto metal2 = loader.tile_atlas("metal2", {2, 2}, pass_mode::blocked),
- tiles = loader.tile_atlas("tiles", {8, 5}, pass_mode::pass);
+ auto metal2 = loader.wall_atlas("concrete1", false);
+ auto tiles = loader.tile_atlas("tiles", {8, 5}, pass_mode::pass);
constexpr auto N = TILE_MAX_DIM;
for (auto [x, k, pt] : c)
x.ground() = { tiles, variant_t(k % tiles->num_tiles()) };
diff --git a/test/wall-atlas2.cpp b/test/wall-atlas2.cpp
index 778b5b0b..23f5a1b8 100644
--- a/test/wall-atlas2.cpp
+++ b/test/wall-atlas2.cpp
@@ -1,7 +1,19 @@
#include "app.hpp"
+#include "compat/assert.hpp"
+#include "src/wall-atlas.hpp"
+#include "loader/loader.hpp"
+#include "loader/wall-info.hpp"
namespace floormat {
-//void test_app::test_wall_atlas2() {}
+void test_app::test_wall_atlas2()
+{
+ Debug{} << "test_wall2: start";
+ static constexpr auto name = "concrete1"_s;
+ auto& a = *loader.wall_atlas(name, false);
+ fm_assert(a.name() == name);
+ fm_assert(a.info().depth == 20);
+ Debug{} << "test_wall2: end";
+}
} // namespace floormat