Fixed some unit tests check functions

This commit is contained in:
Michaël Lemaire 2013-06-01 15:56:20 +02:00
parent b7f64c6d79
commit d2874207f8

View file

@ -37,7 +37,7 @@ static inline int _double_not_equals(double x, double y)
}
static inline int _double_greater(double x, double y)
{
return _double_not_equals(x, y) || (x > y);
return _double_not_equals(x, y) && (x > y);
}
static inline int _double_greater_or_equal(double x, double y)
{
@ -45,7 +45,7 @@ static inline int _double_greater_or_equal(double x, double y)
}
static inline int _double_less(double x, double y)
{
return _double_not_equals(x, y) || (x < y);
return _double_not_equals(x, y) && (x < y);
}
static inline int _double_less_or_equal(double x, double y)
{
@ -56,8 +56,8 @@ static inline int _double_less_or_equal(double x, double 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)
#define ck_assert_double_lt(X, Y) _ck_assert_double(_double_greater_or_equal, X, >=, Y)
#define ck_assert_double_gte(X, Y) _ck_assert_double(_double_less, X, <, Y)
#define ck_assert_double_lt(X, Y) _ck_assert_double(_double_less, X, >=, Y)
#define ck_assert_double_gte(X, Y) _ck_assert_double(_double_greater_or_equal, X, <, Y)
#define ck_assert_double_lte(X, Y) _ck_assert_double(_double_less_or_equal, X, <=, Y)