47#define DATA(...) { __VA_ARGS__ }
70#define CRC32_TEST( name, DATA, SEED, CRC32 ) \
71 static const uint8_t name ## _data[] = DATA; \
72 static struct crc32_test name = { \
73 .data = name ## _data, \
74 .len = sizeof ( name ## _data ), \
84#define crc32_ok( test ) do { \
86 crc32 = crc32_le ( (test)->seed, (test)->data, (test)->len ); \
87 ok ( crc32 == (test)->crc32 ); \
93 0x12345678UL, 0x12345678UL );
95 DATA (
'h',
'e',
'l',
'l',
'o',
' ',
'w',
'o',
'r',
'l',
'd' ),
96 0xffffffffUL, 0xf2b5ee7aUL );
98 DATA (
'h',
'e',
'l',
'l',
'o' ),
99 0xffffffffUL, 0xc9ef5979UL );
101 DATA (
' ',
'w',
'o',
'r',
'l',
'd' ),
102 0xc9ef5979UL, 0xf2b5ee7aUL );
#define DATA(...)
Define inline data.
static void crc32_test_exec(void)
Perform CRC32 self-tests.
#define CRC32_TEST(name, DATA, SEED, CRC32)
Define a CRC32 test.
#define crc32_ok(test)
Report a CRC32 test result.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
uint32_t crc32
Expected CRC32.
size_t len
Length of test data.
const void * data
Test data.
Self-test infrastructure.
#define __self_test
Declare a self-test.