1 AT_BANNER([struct alignment checker unit tests])
3 m4_define([check_structs], [$top_srcdir/build-aux/check-structs])
4 m4_define([RUN_STRUCT_CHECKER],
5 [AT_KEYWORDS([check-structs])
6 AT_SKIP_IF([test $HAVE_PYTHON = no])
9 AT_CHECK_UNQUOTED([$PYTHON check_structs test.h], [$2], [$3], [$4])])
11 AT_SETUP([check struct tail padding])
17 [test.h:3: warning: struct xyz needs 2 bytes of tail padding
21 AT_SETUP([check struct internal alignment])
28 [test.h:3: warning: struct xyzzy member y is 2 bytes short of 4-byte alignment
32 AT_SETUP([check struct declared size])
37 OFP_ASSERT(sizeof(struct wibble) == 12);
40 [test.h:4: warning: struct wibble is 8 bytes long but declared as 12
44 AT_SETUP([check wrong struct's declared size])
49 OFP_ASSERT(sizeof(struct moo) == 8);
53 OFP_ASSERT(sizeof(struct moo) == 8);
54 ], [1], [], [test.h:8: warning: checking size of struct moo but struct wibble was most recently defined