From 900d775c8f4f078dc7cba8557e3991e52d2d5f89 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 5 Dec 2022 07:08:13 +0100 Subject: test: add loader test --- test/app.hpp | 1 + test/loader.cpp | 16 ++++++++++++++++ test/main.cpp | 1 + 3 files changed, 18 insertions(+) create mode 100644 test/loader.cpp (limited to 'test') diff --git a/test/app.hpp b/test/app.hpp index 94b6e506..17ca2b6e 100644 --- a/test/app.hpp +++ b/test/app.hpp @@ -25,5 +25,6 @@ struct test_app final : private FM_APPLICATION static void test_serializer(); static void test_entity(); static void test_quadtree(); + static void test_loader(); }; } // namespace floormat diff --git a/test/loader.cpp b/test/loader.cpp new file mode 100644 index 00000000..a066c973 --- /dev/null +++ b/test/loader.cpp @@ -0,0 +1,16 @@ +#include "app.hpp" +#include "compat/assert.hpp" +#include "loader/loader.hpp" +#include "src/tile-atlas.hpp" + +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); + fm_assert(loader.tile_atlas("texel")->pass_mode() == pass_mode::blocked); + fm_assert(loader.tile_atlas("metal1")->pass_mode() == pass_mode::pass); +} + +} // namespace floormat diff --git a/test/main.cpp b/test/main.cpp index 15654ad2..ec09f55f 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -24,6 +24,7 @@ int test_app::exec() test_const_math(); test_serializer(); test_entity(); + test_loader(); test_quadtree(); return 0; } -- cgit v1.2.3