diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/app.cpp | 1 | ||||
-rw-r--r-- | test/app.hpp | 1 | ||||
-rw-r--r-- | test/loader.cpp | 18 | ||||
-rw-r--r-- | test/scenery.cpp | 21 |
4 files changed, 15 insertions, 26 deletions
diff --git a/test/app.cpp b/test/app.cpp index e896196d..2da424c6 100644 --- a/test/app.cpp +++ b/test/app.cpp @@ -61,7 +61,6 @@ int test_app::exec() FM_TEST(test_loader), FM_TEST(test_serializer1), FM_TEST(test_loader2), - FM_TEST(test_scenery), FM_TEST(test_astar_pool), FM_TEST(test_astar), FM_TEST(test_dijkstra), diff --git a/test/app.hpp b/test/app.hpp index e8669aed..a7814697 100644 --- a/test/app.hpp +++ b/test/app.hpp @@ -38,7 +38,6 @@ struct test_app final : private FM_APPLICATION static void test_magnum_math(); static void test_math(); static void test_raycast(); - static void test_scenery(); static void test_serializer1(); static void test_tile_iter(); static void test_wall_atlas(); diff --git a/test/loader.cpp b/test/loader.cpp index b36ca0ca..4a49b400 100644 --- a/test/loader.cpp +++ b/test/loader.cpp @@ -6,6 +6,7 @@ #include "src/ground-atlas.hpp" #include "src/wall-atlas.hpp" #include "src/anim-atlas.hpp" +#include "src/scenery.hpp" #include <mg/Texture.h> namespace floormat { @@ -33,8 +34,14 @@ constexpr const char* anim_atlases[] = { "anim/npc-walk", "anim/test-8x8", "scenery/door-close", - "scenery/control-panel", - "scenery/table", +}; + +constexpr const char* sceneries[] = { + "bench1", + "shelf6", + "door1", + "control panel (wall) 1", + "table0", }; } // namespace @@ -64,9 +71,14 @@ void test_app::test_loader() fm_assert(!A.raw_frame_array().isEmpty()); fm_assert(A.texture().id()); } + fm_assert(!loader.scenery_list().isEmpty()); + for (const auto& name : sceneries) + { + const auto& S = loader.scenery(name); + fm_assert(S.atlas); + } fm_assert(loader.ground_atlas("texel")->pass_mode() == pass_mode::blocked); fm_assert(loader.ground_atlas("metal1")->pass_mode() == pass_mode::pass); - loader.sceneries(); } void test_app::test_loader2() diff --git a/test/scenery.cpp b/test/scenery.cpp deleted file mode 100644 index 378d2cc1..00000000 --- a/test/scenery.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "app.hpp" -#include "loader/loader.hpp" -#include "loader/scenery-cell.hpp" - -namespace floormat { - -namespace { - -void test_loading() -{ - fm_assert(!loader.sceneries().isEmpty()); -} - -} // namespace - -void test_app::test_scenery() -{ - test_loading(); -} - -} // namespace floormat |