aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/glib-tests-timer.patch
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-07-13 23:44:55 +0200
committerLudovic Courtès <ludo@gnu.org>2014-07-13 23:44:55 +0200
commitc3cf9d36e40713212ffc9d75aa2324ab7bad4f9b (patch)
tree1d04f8c542b78e1510a8d29163e578fe2538d81e /gnu/packages/patches/glib-tests-timer.patch
parent314a83ef1e80b47b44debc1118e38d7f761e0e7f (diff)
parentca9ea1a849d685db46adcb92449dff36427c48bd (diff)
downloadguix-c3cf9d36e40713212ffc9d75aa2324ab7bad4f9b.tar
guix-c3cf9d36e40713212ffc9d75aa2324ab7bad4f9b.tar.gz
Merge branch 'bug-17853'
Diffstat (limited to 'gnu/packages/patches/glib-tests-timer.patch')
-rw-r--r--gnu/packages/patches/glib-tests-timer.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/gnu/packages/patches/glib-tests-timer.patch b/gnu/packages/patches/glib-tests-timer.patch
new file mode 100644
index 0000000000..1ac364fcc1
--- /dev/null
+++ b/gnu/packages/patches/glib-tests-timer.patch
@@ -0,0 +1,26 @@
+* On i686 floating-point roundoff errors could sometimes cause this check to
+ fail depending on the elapsed microseconds. Improve rounding by adding a
+ fractional bit.
+
+* The /timer/stop test fails if compiler optimizations are enabled, which they
+ are by default. Disable that test.
+
+--- glib-2.40.0/glib/tests/timer.c 2014-03-05 08:05:42.000000000 -0600
++++ glib-2.40.0/glib/tests/timer.c 2014-07-10 16:33:12.746862822 -0500
+@@ -35,7 +35,7 @@
+ elapsed = g_timer_elapsed (timer, &micros);
+
+ g_assert_cmpfloat (elapsed, <, 1.0);
+- g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6)) % 1000000);
++ g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6 + 0.5)) % 1000000);
+
+ g_timer_destroy (timer);
+ }
+@@ -204,7 +204,6 @@
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/timer/basic", test_timer_basic);
+- g_test_add_func ("/timer/stop", test_timer_stop);
+ g_test_add_func ("/timer/continue", test_timer_continue);
+ g_test_add_func ("/timer/reset", test_timer_reset);
+ g_test_add_func ("/timeval/add", test_timeval_add);