diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-11 02:33:56 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-11 02:33:56 +0200 |
commit | b4ca16e3393138322f0a746db4406314386cde50 (patch) | |
tree | a3f0bcbf6e1c0c71df865aa12dc57225dcc7f9ee /test | |
parent | d74228a9f508e96fd93be27cebd20df056e4ef4b (diff) |
a
Diffstat (limited to 'test')
-rw-r--r-- | test/bitmask.cpp | 9 | ||||
-rw-r--r-- | test/bitmask.embed.inc | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/test/bitmask.cpp b/test/bitmask.cpp index 7facb40b..f6abea14 100644 --- a/test/bitmask.cpp +++ b/test/bitmask.cpp @@ -11,11 +11,11 @@ namespace floormat { namespace { -const unsigned char img_bitmask[] = { +const unsigned char src[] = { #include "bitmask.embed.inc" }; -constexpr auto data_nbytes = arraySize(img_bitmask); +constexpr auto data_nbytes = arraySize(src); constexpr auto size = Vector2i{8, 16}; static_assert(size_t{size.product()+7}/8 <= data_nbytes); @@ -38,9 +38,10 @@ void bitmask_test() fflush(stdout); #endif 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] != img_bitmask[i]) - fm_abort("wrong value at byte %zu, should be' 0x%02hhx'", i, img_bitmask[i]); + if ((unsigned char)bitmask.data()[i] != src[i]) + fm_abort("wrong value at byte %zu, should be' 0x%02hhx'", i, src[i]); } } // namespace diff --git a/test/bitmask.embed.inc b/test/bitmask.embed.inc index fa8268dd..1dcc633e 100644 --- a/test/bitmask.embed.inc +++ b/test/bitmask.embed.inc @@ -5,4 +5,4 @@ 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, |