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 <keithp@keithp.com>
This commit is contained in:
		
							parent
							
								
									f75bdf7fbe
								
							
						
					
					
						commit
						e7df42ab68
					
				| 
						 | 
					@ -1001,10 +1001,12 @@ test_convert_XITouchOwnershipEvent(void)
 | 
				
			||||||
        test_XITouchOwnershipEvent(&in);
 | 
					        test_XITouchOwnershipEvent(&in);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (i = 1; i <= 0xFFFFFFFF; i <<= 1)
 | 
					    for (i = 1; ; i <<= 1)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        in.touchid = i;
 | 
					        in.touchid = i;
 | 
				
			||||||
        test_XITouchOwnershipEvent(&in);
 | 
					        test_XITouchOwnershipEvent(&in);
 | 
				
			||||||
 | 
						if (i == (1 << 31))
 | 
				
			||||||
 | 
						    break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue