[PATCH libinput 04/15] test: fix double comparison macros

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 17 21:45:05 PST 2015


args needs to be within () to ensure correct calculation

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/litest.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/litest.h b/test/litest.h
index 4553c87..dd1ad9a 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -195,22 +195,22 @@ struct libevdev_uinput * litest_create_uinput_abs_device(const char *name,
 							 const struct input_absinfo *abs,
 							 ...);
 #define litest_assert_double_eq(a_, b_)\
-	ck_assert_int_eq((int)(a_ * 256), (int)(b_ * 256))
+	ck_assert_int_eq((int)(a_ * 256), (int)((b_) * 256))
 
 #define litest_assert_double_ne(a_, b_)\
-	ck_assert_int_ne((int)(a_ * 256), (int)(b_ * 256))
+	ck_assert_int_ne((int)(a_ * 256), (int)((b_) * 256))
 
 #define litest_assert_double_lt(a_, b_)\
-	ck_assert_int_lt((int)(a_ * 256), (int)(b_ * 256))
+	ck_assert_int_lt((int)(a_ * 256), (int)((b_) * 256))
 
 #define litest_assert_double_le(a_, b_)\
-	ck_assert_int_le((int)(a_ * 256), (int)(b_ * 256))
+	ck_assert_int_le((int)(a_ * 256), (int)((b_) * 256))
 
 #define litest_assert_double_gt(a_, b_)\
-	ck_assert_int_gt((int)(a_ * 256), (int)(b_ * 256))
+	ck_assert_int_gt((int)(a_ * 256), (int)((b_) * 256))
 
 #define litest_assert_double_ge(a_, b_)\
-	ck_assert_int_ge((int)(a_ * 256), (int)(b_ * 256))
+	ck_assert_int_ge((int)(a_ * 256), (int)((b_) * 256))
 
 void litest_timeout_tap(void);
 void litest_timeout_softbuttons(void);
-- 
2.1.0



More information about the wayland-devel mailing list