From 5e1e20c6240d9b905514b850f861296f5e6c1254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Tue, 18 Aug 2015 15:21:02 +0000 Subject: [PATCH] Add marginally useful test cases based on t_zero. --- t/t_adler.c | 7 +++++++ t/t_fletcher.c | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/t/t_adler.c b/t/t_adler.c index 7d68ff8..f861e30 100644 --- a/t/t_adler.c +++ b/t/t_adler.c @@ -101,6 +101,13 @@ static struct t_case t_cases[] = { .len = 8, .sum = 0x00800025, }, + { + .desc = "zeroes", + .data = (const char *)t_zero, + .len = sizeof t_zero, + .sum = (sizeof t_zero << 16) | 1, + }, + /* XXX need non-zero cases which exercise modulo */ }; /*************************************************************************** diff --git a/t/t_fletcher.c b/t/t_fletcher.c index 3fb963e..61c8837 100644 --- a/t/t_fletcher.c +++ b/t/t_fletcher.c @@ -54,8 +54,8 @@ static struct t_case t_cases[] = { .data = "\x01\x02\x03\x04\x05\x06\x07\x08", .len = 0, .sum16 = 0x00, - .sum32 = 0x00, - .sum64 = 0x00, + .sum32 = 0x0000, + .sum64 = 0x00000000, }, { .desc = "len == 1", @@ -121,6 +121,16 @@ static struct t_case t_cases[] = { .sum32 = 0x1e281014, .sum64 = 0x070a0d1006080a0c, }, + /* not really useful... */ + { + .desc = "zeroes", + .data = (const char *)t_zero, + .len = sizeof t_zero, + .sum16 = 0x00, + .sum32 = 0x0000, + .sum64 = 0x00000000, + }, + /* XXX need non-zero cases which exercise modulo */ }; /***************************************************************************