summaryrefslogtreecommitdiffhomepage
path: root/test/bitmask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/bitmask.cpp')
-rw-r--r--test/bitmask.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/bitmask.cpp b/test/bitmask.cpp
index f6abea14..d0b6c4d8 100644
--- a/test/bitmask.cpp
+++ b/test/bitmask.cpp
@@ -3,7 +3,6 @@
#include "src/anim-atlas.hpp"
#include "loader/loader.hpp"
#include <Corrade/Containers/ArrayView.h>
-#include <Corrade/Containers/StridedArrayView.h>
#include <mg/Functions.h>
#include <mg/ImageData.h>
@@ -16,12 +15,12 @@ const unsigned char src[] = {
};
constexpr auto data_nbytes = arraySize(src);
-constexpr auto size = Vector2i{8, 16};
-static_assert(size_t{size.product()+7}/8 <= data_nbytes);
+constexpr auto size = Vector2i{21, 52};
+//static_assert(size_t{size.product()+7}/8 <= data_nbytes);
void bitmask_test()
{
- auto img = loader.texture(loader.SCENERY_PATH, "door-close"_s);
+ auto img = loader.texture(loader.SCENERY_PATH, "control-panel"_s);
auto bitmask = anim_atlas::make_bitmask(img);
fm_assert(bitmask.size() >= size_t{size.product()});
fm_assert(img.pixelSize() == 4);
@@ -40,8 +39,11 @@ void bitmask_test()
const auto len = Math::min(data_nbytes, (size_t)bitmask.size()+7 >> 3);
fm_assert(arraySize(src) >= len);
for (auto i = 0uz; i < len; i++)
- if ((unsigned char)bitmask.data()[i] != src[i])
- fm_abort("wrong value at byte %zu, should be' 0x%02hhx'", i, src[i]);
+ {
+ auto a = (unsigned char)bitmask.data()[i];
+ if (a != src[i])
+ fm_abort("wrong value 0x%02hhx at byte %zu, should be' 0x%02hhx'", a, i, src[i]);
+ }
}
} // namespace