summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/app.hpp1
-rw-r--r--test/json.cpp3
-rw-r--r--test/save.cpp8
-rw-r--r--test/tile-iter.cpp37
4 files changed, 3 insertions, 46 deletions
diff --git a/test/app.hpp b/test/app.hpp
index b2575433..3aa24b73 100644
--- a/test/app.hpp
+++ b/test/app.hpp
@@ -43,7 +43,6 @@ struct test_app final : private FM_APPLICATION
static void test_save();
static void test_saves();
static void test_script();
- static void test_tile_iter();
static void test_wall_atlas();
static void test_wall_atlas2();
diff --git a/test/json.cpp b/test/json.cpp
index 5733c691..372465b5 100644
--- a/test/json.cpp
+++ b/test/json.cpp
@@ -1,13 +1,10 @@
#include "app.hpp"
-#include "serialize/tile.hpp"
#include "serialize/ground-atlas.hpp"
#include "serialize/wall-atlas.hpp"
#include "serialize/magnum-vector.hpp"
#include "serialize/json-helper.hpp"
#include "compat/assert.hpp"
#include "src/ground-atlas.hpp"
-#include "src/tile.hpp"
-#include "src/tile-iterator.hpp"
#include "src/chunk.hpp"
#include "src/world.hpp"
#include "loader/loader.hpp"
diff --git a/test/save.cpp b/test/save.cpp
index 2df1d296..bc3ed954 100644
--- a/test/save.cpp
+++ b/test/save.cpp
@@ -8,7 +8,6 @@
#include "src/light.hpp"
#include "src/ground-atlas.hpp"
#include "src/anim-atlas.hpp"
-#include "src/tile-iterator.hpp"
#include "src/nanosecond.inl"
#include <Corrade/Utility/Path.h>
@@ -27,11 +26,10 @@ chunk& test_app::make_test_chunk(world& w, chunk_coords_ ch)
auto table = loader.scenery("table1");
auto control_panel = loader.scenery("control panel (wall) 1");
- constexpr auto N = TILE_MAX_DIM;
- for (auto [x, k, pt] : c)
- x.ground() = { tiles, variant_t(k % tiles->num_tiles()) };
+ for (auto k = 0u; k < TILE_COUNT; k++)
+ c[k].ground() = { tiles, variant_t(k % tiles->num_tiles()) };
control_panel.r = rotation::W;
- constexpr auto K = N/2;
+ constexpr auto K = TILE_MAX_DIM/2;
c[{K, K }].wall_north() = { metal2, 0 };
c[{K, K }].wall_west() = { metal2, 0 };
c[{K, K+1}].wall_north() = { metal2, 0 };
diff --git a/test/tile-iter.cpp b/test/tile-iter.cpp
deleted file mode 100644
index 086fd3ce..00000000
--- a/test/tile-iter.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "app.hpp"
-#include "src/chunk.hpp"
-#include "src/world.hpp"
-#include "src/tile-iterator.hpp"
-namespace floormat {
-
-static inline bool always_false()
-{
- volatile bool ret = false;
- return ret;
-}
-
-void test_app::test_tile_iter() // NOLINT(readability-function-size)
-{
- if (always_false())
- {
- world w;
- const chunk c{w, {}};
- for ([[maybe_unused]] const auto& [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile_proto>);
- for ([[maybe_unused]] const auto [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile_proto>);
- for ([[maybe_unused]] auto [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), tile_proto>);
- }
- if (always_false())
- {
- world w;
- chunk c{w, {}};
- for ([[maybe_unused]] auto [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), tile_ref>);
- for ([[maybe_unused]] const auto [x, k, pt] : c)
- static_assert(std::is_same_v<decltype(x), const tile_ref>);
- }
-}
-
-} // namespace floormat