From d713447f54c19eebce0a9d56953ed923fe2d9274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Sun, 16 Jun 2013 16:12:30 +0200 Subject: [PATCH] Improved double display precision in unit tests Now using a display precision better than compare precision --- Makefile | 3 +-- src/testing/common.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 99ed38e..e3308d6 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,7 @@ debug: release: make BUILDMODE=release all -tests: - make BUILDMODE=${BUILDMODE} all +tests: all LD_LIBRARY_PATH=${BUILDPATH} CK_DEFAULT_TIMEOUT=30 ${BUILDPATH}/paysages-tests run_cli: all diff --git a/src/testing/common.h b/src/testing/common.h index fa4188f..fe5d76c 100644 --- a/src/testing/common.h +++ b/src/testing/common.h @@ -59,7 +59,7 @@ static inline int _double_less_or_equal(double x, double y) return _double_equals(x, y) || (x <= y); } -#define _ck_assert_double(F, X, O, Y) ck_assert_msg(F(X, Y), "Assertion '"#X#O#Y"' failed: "#X"=%f, "#Y"=%f", X, Y) +#define _ck_assert_double(F, X, O, Y) ck_assert_msg(F(X, Y), "Assertion '"#X#O#Y"' failed: "#X"=%.12f, "#Y"=%.12f", X, Y) #define ck_assert_double_eq(X, Y) _ck_assert_double(_double_equals, X, ==, Y) #define ck_assert_double_ne(X, Y) _ck_assert_double(_double_not_equals, X, !=, Y) #define ck_assert_double_gt(X, Y) _ck_assert_double(_double_greater, X, >, Y)