diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 07:08:13 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 07:09:10 +0100 |
commit | 900d775c8f4f078dc7cba8557e3991e52d2d5f89 (patch) | |
tree | e7a275ddc4093933e417cde8bc8b935c6ad90199 /test | |
parent | 2e72c24867e74b057915d2fbc203a72d44e2a7e3 (diff) |
test: add loader test
Diffstat (limited to 'test')
-rw-r--r-- | test/app.hpp | 1 | ||||
-rw-r--r-- | test/loader.cpp | 16 | ||||
-rw-r--r-- | test/main.cpp | 1 |
3 files changed, 18 insertions, 0 deletions
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; } |