aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2020-09-12 00:53:04 +0100
committerTomasz Kramkowski <tk@the-tk.com>2020-09-12 00:53:04 +0100
commite8dc6f3d53aed8b251a37823118f20d0b06b03b0 (patch)
tree315a97b5c648a495506b14a66343a5ebf3ca772a
parente7479225f204c4b6c10addb850d678c95bdffcd8 (diff)
downloadpack-e8dc6f3d53aed8b251a37823118f20d0b06b03b0.tar.gz
pack-e8dc6f3d53aed8b251a37823118f20d0b06b03b0.tar.xz
pack-e8dc6f3d53aed8b251a37823118f20d0b06b03b0.zip
test: Make DATA macro more useful.
-rw-r--r--test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test.c b/test.c
index 08b03b3..1621f3b 100644
--- a/test.c
+++ b/test.c
@@ -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; \