Improved double display precision in unit tests

Now using a display precision better than compare precision
This commit is contained in:
Michaël Lemaire 2013-06-16 16:12:30 +02:00
parent 284b43362e
commit d713447f54
2 changed files with 2 additions and 3 deletions

View file

@ -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

View file

@ -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)