diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2020-09-12 00:53:04 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2020-09-12 00:53:04 +0100 |
commit | e8dc6f3d53aed8b251a37823118f20d0b06b03b0 (patch) | |
tree | 315a97b5c648a495506b14a66343a5ebf3ca772a | |
parent | e7479225f204c4b6c10addb850d678c95bdffcd8 (diff) | |
download | pack-e8dc6f3d53aed8b251a37823118f20d0b06b03b0.tar.gz pack-e8dc6f3d53aed8b251a37823118f20d0b06b03b0.tar.xz pack-e8dc6f3d53aed8b251a37823118f20d0b06b03b0.zip |
test: Make DATA macro more useful.
-rw-r--r-- | test.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -22,11 +22,11 @@ struct test { __attribute__((__used__)) = \ { test_##name, desc }; \ static bool test_##name(void) -#define DATA(...) (unsigned char []){ __VA_ARGS__ }, sizeof (unsigned char []){ __VA_ARGS__ } +#define DATA(...) (unsigned char []){ __VA_ARGS__ } #define CHECK(test) if (!(test)) { puts("! " #test); return false; } #define CHECK_UNPACK(data, fmt, ...) do { \ - enum pack_status CHECK_UNPACK_s = unpack(data, fmt, __VA_ARGS__); \ + enum pack_status CHECK_UNPACK_s = unpack(data, sizeof (data), fmt, __VA_ARGS__); \ if (CHECK_UNPACK_s != PACK_OK) { \ printf(__FILE__ ":%d unpack(" #data ", " #fmt ", ...) -> %s (%d)\n", __LINE__, pack_strerror(CHECK_UNPACK_s), CHECK_UNPACK_s); \ return false; \ |