mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
glib/tests: fix random failure due to rounding
GLib:ERROR:../glib/tests/timer.c:41:test_timer_basic: assertion failed (micros == ((guint64)(elapsed * 1e6)) % 1000000): (11 == 10) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
b3d6946c27
commit
20f8007f73
@ -56,7 +56,7 @@ test_timer_basic (void)
|
||||
elapsed = g_timer_elapsed (timer, µs);
|
||||
|
||||
g_assert_cmpfloat (elapsed, <, 1.0);
|
||||
g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6)) % 1000000);
|
||||
g_assert_cmpfloat_with_epsilon (elapsed, micros / 1e6, 0.001);
|
||||
|
||||
g_timer_destroy (timer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user