diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-06-15 17:01:38 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-06-22 20:01:08 +0300 |
commit | bebccd097a6d7cf5515111fb7dab07cdc76d3017 (patch) | |
tree | a617956464aa707f69989e27431c74ac2db2b92d /tests | |
parent | 7ad329021f5f7d643cc6aade1c54a6bca805bd98 (diff) |
tests/kms_flip: Use USEC_PER_SEC
Replace some opencoded numbers with USEC_PER_SEC, and
print the usec_diff with 6 decimal digits to make things
more consistent.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/kms_flip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 7b526b5e..743e4ad8 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -717,15 +717,15 @@ static void check_state_correlation(struct test_output *o, return; timersub(&es2->current_ts, &es1->current_ts, &tv_diff); - usec_diff = tv_diff.tv_sec * 1000 * 1000 + tv_diff.tv_usec; + usec_diff = tv_diff.tv_sec * USEC_PER_SEC + tv_diff.tv_usec; seq_diff = es2->current_seq - es1->current_seq; ftime = frame_time(o); usec_diff -= seq_diff * ftime; igt_assert_f(fabs(usec_diff) / ftime <= 0.005, - "timestamp mismatch between %s and %s (diff %.4f sec)\n", - es1->name, es2->name, usec_diff / 1000 / 1000); + "timestamp mismatch between %s and %s (diff %.6f sec)\n", + es1->name, es2->name, usec_diff / USEC_PER_SEC); } static void check_all_state(struct test_output *o, |