diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-10 02:26:01 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-10 02:28:52 +0100 |
commit | e83e86e8ad1fa80557039071df2522670527b808 (patch) | |
tree | b68988988182de36e8bebf42d33837d1f0a9fe97 | |
parent | 223fd23e6431ab4e0b2e4b918d50d1b8cf192f36 (diff) |
fix test failure
-rw-r--r-- | test/loader.cpp | 16 | ||||
-rw-r--r-- | test/wall-atlas2.cpp | 16 |
2 files changed, 28 insertions, 4 deletions
diff --git a/test/loader.cpp b/test/loader.cpp index c517d00a..3c5ebf30 100644 --- a/test/loader.cpp +++ b/test/loader.cpp @@ -53,8 +53,20 @@ void test_app::test_loader() (void)loader.get_wall_atlas(name); for (const auto& x : loader.ground_atlas_list()) - if (x.name != loader.INVALID) // todo! - (void)loader.ground_atlas(x.name); + { + if (x.name != loader.INVALID) + { + (void)loader.ground_atlas(x.name); + fm_assert(x.atlas); + fm_assert(x.atlas == loader.ground_atlas(x.name)); + } + else + { + fm_assert(x.atlas); + fm_assert(loader.make_invalid_ground_atlas().atlas); + fm_assert(x.atlas == loader.make_invalid_ground_atlas().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(); diff --git a/test/wall-atlas2.cpp b/test/wall-atlas2.cpp index 8387d656..f112c1c6 100644 --- a/test/wall-atlas2.cpp +++ b/test/wall-atlas2.cpp @@ -18,8 +18,20 @@ void test_loading() fm_assert(loader.wall_atlas("test1"_s) == loader.wall_atlas("test1"_s)); fm_assert(loader.wall_atlas("test1"_s) != loader.wall_atlas(loader.INVALID, loader_policy::ignore)); } - for (const auto& info : loader.wall_atlas_list()) - fm_assert(loader.wall_atlas(info.name)); + for (const auto& x : loader.wall_atlas_list()) + { + if (x.name != loader.INVALID) + { + (void)loader.wall_atlas(x.name); + fm_assert(x.atlas); + fm_assert(x.atlas == loader.wall_atlas(x.name)); + } + else + { + fm_assert(loader.make_invalid_wall_atlas().atlas); + fm_assert(x.atlas == loader.make_invalid_wall_atlas().atlas); + } + } } void test_empty_wall() |