From 43b8f4e75a32d4b14bd16259af600e1364d68821 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sun, 16 Apr 2017 23:35:38 -0700 Subject: Use a tolerance for assertions on exact score This caused the test suite to fail on i386 (and possibly other archs), because the value was off my a minute amount due to floating point representation. --- test/test_match.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_match.c b/test/test_match.c index 00dcdb0..8d52191 100644 --- a/test/test_match.c +++ b/test/test_match.c @@ -5,7 +5,8 @@ #include "greatest/greatest.h" -#define ASSERT_SCORE_EQ(a,b) ASSERT_EQ_FMT((a), (b), "%f") +#define SCORE_TOLERANCE 0.000001 +#define ASSERT_SCORE_EQ(a,b) ASSERT_IN_RANGE((a), (b), SCORE_TOLERANCE) #define ASSERT_INT_EQ(a,b) ASSERT_EQ_FMT((a), (b), "%d") /* has_match(char *needle, char *haystack) */ -- cgit v1.2.3