Re: [PATCH] test: compare byte padding macros against the expected bytes.

2010-11-22 Thread Julien Cristau
On Fri, Nov 19, 2010 at 11:26:13 +1000, Peter Hutterer wrote:

 We calculate the expected bytes for each value, let's use it.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  test/input.c |3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
 
Reviewed-by: Julien Cristau jcris...@debian.org

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH] test: compare byte padding macros against the expected bytes.

2010-11-18 Thread Peter Hutterer
We calculate the expected bytes for each value, let's use it.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
---
 test/input.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/test/input.c b/test/input.c
index f8ce4b2..13a441e 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));
 }
 
 }
-- 
1.7.3.2
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel