diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-02-05 10:59:52 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-11-24 08:47:00 +1000 |
commit | f49ee9074a66883a3c525b0d6e71589123288465 (patch) | |
tree | 589e3ec91e50bbc95ebc25b165b0eea6cafcc306 /test | |
parent | b31df0439fe336a43a2355e2f1fb223d86045a05 (diff) |
test: compare byte padding macros against the expected bytes.
We calculate the expected bytes for each value, let's use it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/input.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/input.c b/test/input.c index f8ce4b2df..13a441e9f 100644 --- a/test/input.c +++ b/test/input.c @@ -696,6 +696,7 @@ static void include_byte_padding_macros(void) g_assert(bits_to_bytes(i) >= i/8); g_assert((bits_to_bytes(i) * 8) - i <= 7); + g_assert(expected_bytes == bits_to_bytes(i)); } g_test_message("Testing bytes_to_int32()"); @@ -706,6 +707,7 @@ static void include_byte_padding_macros(void) g_assert(bytes_to_int32(i) <= i); g_assert((bytes_to_int32(i) * 4) - i <= 3); + g_assert(expected_4byte == bytes_to_int32(i)); } g_test_message("Testing pad_to_int32"); @@ -717,6 +719,7 @@ static void include_byte_padding_macros(void) g_assert(pad_to_int32(i) >= i); g_assert(pad_to_int32(i) - i <= 3); + g_assert(expected_bytes == pad_to_int32(i)); } } |