gnu: hidapi: Fix 'license'.
[jackhill/guix/guix.git] / gnu / packages / patches / glib-tests-timer.patch
1 * On i686 floating-point roundoff errors could sometimes cause this check to
2 fail depending on the elapsed microseconds. Improve rounding by adding a
3 fractional bit.
4
5 --- glib-2.40.0/glib/tests/timer.c 2014-03-05 08:05:42.000000000 -0600
6 +++ glib-2.40.0/glib/tests/timer.c 2014-07-10 16:33:12.746862822 -0500
7 @@ -35,7 +35,7 @@
8 elapsed = g_timer_elapsed (timer, &micros);
9
10 g_assert_cmpfloat (elapsed, <, 1.0);
11 - g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6)) % 1000000);
12 + g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6 + 0.5)) % 1000000);
13
14 g_timer_destroy (timer);
15 }