[systemd-commits] src/test

Thomas H.P. Andersen phomes at kemper.freedesktop.org
Tue Dec 16 11:38:16 PST 2014


 src/test/test-json.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 30c873fbfb9bb291330d50aae8fb67d774a0e4f8
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Tue Dec 16 20:36:40 2014 +0100

    test-json: use fabs

diff --git a/src/test/test-json.c b/src/test/test-json.c
index 8777cf7..0076835 100644
--- a/src/test/test-json.c
+++ b/src/test/test-json.c
@@ -19,6 +19,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <math.h>
+
 #include "log.h"
 #include "util.h"
 #include "json.h"
@@ -52,7 +54,7 @@ static void test_one(const char *data, ...) {
                         double d;
 
                         d = va_arg(ap, double);
-                        assert_se(abs(d - v.real) < 0.001);
+                        assert_se(fabs(d - v.real) < 0.001);
 
                 } else if (t == JSON_INTEGER) {
                         intmax_t i;



More information about the systemd-commits mailing list