public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_flip: Adjust tolerance when counting frames
@ 2016-05-10 13:27 Gabriel Feceoru
  2016-05-10 13:52 ` Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Gabriel Feceoru @ 2016-05-10 13:27 UTC (permalink / raw)
  To: intel-gfx; +Cc: daniel.vetter

Comparing 2 numbers with 1% accuracy depends on which one is the
reference. If count == 100 and expected == 99 this condition fails,
although it should pass.

Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com>
---
 tests/kms_flip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index eda2fcc..938b32d 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1187,7 +1187,8 @@ static void check_final_state(struct test_output *o, struct event_state *es,
 
 		count *= o->seq_step;
 		expected = elapsed / frame_time(o);
-		igt_assert_f(count >= expected * 99/100 && count <= expected * 101/100,
+		igt_assert_f((count >= expected * 99/100 && count <= expected * 101/100) ||
+			     (expected >= count * 99/100 && expected <= count * 101/100),
 			     "dropped frames, expected %d, counted %d, encoder type %d\n",
 			     expected, count, o->kencoder[0]->encoder_type);
 	}
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-05-17  7:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 13:27 [PATCH i-g-t] tests/kms_flip: Adjust tolerance when counting frames Gabriel Feceoru
2016-05-10 13:52 ` Jani Nikula
2016-05-10 14:15   ` Gabriel Feceoru
2016-05-17  7:30     ` Daniel Vetter
2016-05-17  7:41       ` Chris Wilson
2016-05-10 14:33 ` [PATCH i-g-t v2] " Gabriel Feceoru
2016-05-10 15:39   ` Jani Nikula
2016-05-11 12:35     ` Gabriel Feceoru
2016-05-13  5:45       ` Jani Nikula
2016-05-13 11:45 ` [PATCH i-g-t v3] " Gabriel Feceoru
2016-05-13 12:00   ` Chris Wilson
2016-05-13 12:04     ` Chris Wilson
2016-05-13 12:54     ` Gabriel Feceoru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox