From e7df42ab68e30588a5e32ed543b0711821daf009 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 22 Dec 2011 09:35:51 -0800 Subject: test/xi2: Fix infinite loop in test_convert_XITouchOwnershipEvent The touchid test was using a loop like: for(i = 1; i < 0xffffffff; i <<= 1) When 'i' is a 32-bit variable, this infinite loops as it goes from 0x80000000 to 0. 'i' is declared as 'long', which is 32-bit in 32-bit mode. Signed-off-by: Keith Packard --- test/xi2/protocol-eventconvert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c index 9872b793a..faa9f407a 100644 --- a/test/xi2/protocol-eventconvert.c +++ b/test/xi2/protocol-eventconvert.c @@ -1001,10 +1001,12 @@ test_convert_XITouchOwnershipEvent(void) test_XITouchOwnershipEvent(&in); } - for (i = 1; i <= 0xFFFFFFFF; i <<= 1) + for (i = 1; ; i <<= 1) { in.touchid = i; test_XITouchOwnershipEvent(&in); + if (i == (1 << 31)) + break; } } -- cgit v1.2.3