summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-10 06:12:44 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-10 06:17:31 +0100
commit5fd11965fbde71e56423da13955069aa92c28d30 (patch)
tree7734525da8abbbf3828b167eb13ed609b9d25f7e /test
parent91679b2836881d98333599f6b6602ccad7e37fd1 (diff)
test: don't load in the atlases multiple times
Diffstat (limited to 'test')
-rw-r--r--test/loader.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/loader.cpp b/test/loader.cpp
index 3c5ebf30..c51ad971 100644
--- a/test/loader.cpp
+++ b/test/loader.cpp
@@ -3,6 +3,8 @@
#include "loader/loader.hpp"
#include "loader/wall-cell.hpp"
#include "src/ground-atlas.hpp"
+#include "src/wall-atlas.hpp"
+#include <mg/Texture.h>
namespace floormat {
@@ -46,11 +48,20 @@ void test_app::test_loader()
fm_assert(loader.make_invalid_wall_atlas().name == loader.INVALID);
for (const auto& str : anim_atlases)
- (void)loader.get_anim_atlas(str);
+ (void)loader.anim_atlas(str, {});
for (const auto& x : ground_atlases)
- (void)loader.get_ground_atlas(x.name, x.size, x.pass);
+ {
+ auto& A = *loader.ground_atlas(x.name);
+ fm_assert(A.num_tiles2() == x.size);
+ fm_assert(A.pass_mode() == x.pass);
+ fm_assert(A.texture().id());
+ }
for (const auto& name : wall_atlases)
- (void)loader.get_wall_atlas(name);
+ {
+ auto& A = *loader.wall_atlas(name);
+ fm_assert(!A.raw_frame_array().isEmpty());
+ fm_assert(A.texture().id());
+ }
for (const auto& x : loader.ground_atlas_list())
{
@@ -63,7 +74,6 @@ void test_app::test_loader()
else
{
fm_assert(x.atlas);
- fm_assert(loader.make_invalid_ground_atlas().atlas);
fm_assert(x.atlas == loader.make_invalid_ground_atlas().atlas);
}
}
@@ -71,7 +81,7 @@ void test_app::test_loader()
fm_assert(loader.ground_atlas("metal1")->pass_mode() == pass_mode::pass);
loader.sceneries();
for (StringView name : loader.anim_atlas_list())
- loader.anim_atlas(name);
+ loader.anim_atlas(name, loader.ANIM_PATH);
}
} // namespace floormat