coord: test for proper packing

This commit is contained in:
Danny Robson 2015-09-21 15:27:36 +10:00
parent 864cedc257
commit ec42319224
2 changed files with 22 additions and 0 deletions

View File

@ -347,6 +347,7 @@ TEST_BIN = \
test/checksum \
test/cmdopt \
test/colour \
test/coord \
test/crypto/arc4 \
test/crypto/tea \
test/crypto/xtea \

21
test/coord.cpp Normal file
View File

@ -0,0 +1,21 @@
#include "tap.hpp"
#include "point.hpp"
int
main (void)
{
static_assert (sizeof (util::point1u) == 1 * sizeof (util::point1u::value_type), "point1u is not packed");
static_assert (sizeof (util::point2u) == 2 * sizeof (util::point2u::value_type), "point2u is not packed");
static_assert (sizeof (util::point3u) == 3 * sizeof (util::point3u::value_type), "point3u is not packed");
static_assert (sizeof (util::point4u) == 4 * sizeof (util::point4u::value_type), "point4u is not packed");
static_assert (sizeof (util::point1f) == 1 * sizeof (util::point1f::value_type), "point1f is not packed");
static_assert (sizeof (util::point2f) == 2 * sizeof (util::point2f::value_type), "point2f is not packed");
static_assert (sizeof (util::point3f) == 3 * sizeof (util::point3f::value_type), "point3f is not packed");
static_assert (sizeof (util::point4f) == 4 * sizeof (util::point4f::value_type), "point4f is not packed");
util::TAP::logger t;
t.expect (true, "packing tests");
return t.status ();
}