[05/22] test_flip: fix checking for delayed event reception
diff mbox

Message ID 1350398096-3649-6-git-send-email-imre.deak@intel.com
State New, archived
Headers show

Commit Message

Imre Deak Oct. 16, 2012, 2:34 p.m. UTC
The intent for the time limit seems to be 2ms, but the current condition
will result in a 1s limit and makes the check against tv_usec redundant.
Fix the condition to check for a 2ms limit.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/flip_test.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

diff --git a/tests/flip_test.c b/tests/flip_test.c
index 5e39db6..ed8c12b 100644
--- a/tests/flip_test.c
+++ b/tests/flip_test.c
@@ -183,7 +183,7 @@  static void page_flip_handler(int fd, unsigned int frame, unsigned int sec,
 
 	timersub(&pageflip_ts, &now, &diff);
 
-	if (diff.tv_sec > 0 || (diff.tv_sec > 0 && diff.tv_usec > 2000)) {
+	if (diff.tv_sec > 0 || (diff.tv_sec == 0 && diff.tv_usec > 2000)) {
 		fprintf(stderr, "pageflip timestamp delayed for too long: %is, %iusec\n",
 			(int) diff.tv_sec, (int) diff.tv_usec);
 		exit(5);