changeset 40001:a8842ede7b0d

times: Fix tests. * tests/test-times.c (doublecmp): Implement a total order.
author Bruno Haible <bruno@clisp.org>
date Tue, 11 Dec 2018 20:21:52 +0100
parents 5361c721aa56
children 17b50b81745a
files ChangeLog tests/test-times.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Dec 11 20:36:35 2018 +0100
+++ b/ChangeLog	Tue Dec 11 20:21:52 2018 +0100
@@ -1,3 +1,8 @@
+2018-12-11  Bruno Haible  <bruno@clisp.org>
+
+	times: Fix tests.
+	* tests/test-times.c (doublecmp): Implement a total order.
+
 2018-12-11  Bruno Haible  <bruno@clisp.org>
 
 	array-set, linkedhash-set, hash-set: Fix tests.
--- a/tests/test-times.c	Tue Dec 11 20:36:35 2018 +0100
+++ b/tests/test-times.c	Tue Dec 11 20:21:52 2018 +0100
@@ -35,7 +35,7 @@
   double a = *(double *) p;
   double b = *(double *) q;
 
-  return a < b;
+  return a < b ? -1 : a > b ? 1 : 0;
 }
 
 int