From f454d6080814b88cd02b3b7e11b2cdb743081b20 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 15 May 2017 17:25:44 +0200 Subject: [PATCH] src/testing.h: Fix result of EXPECT_EQ_DOUBLE() when actual is NAN. --- src/testing.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/testing.h b/src/testing.h index 42f45ce6..96b6ba9c 100644 --- a/src/testing.h +++ b/src/testing.h @@ -104,7 +104,8 @@ static int check_count__ = 0; do { \ double want__ = (double)expect; \ double got__ = (double)actual; \ - if (isnan(want__) && !isnan(got__)) { \ + if ((isnan(want__) && !isnan(got__)) || \ + (!isnan(want__) && isnan(got__))) { \ printf("not ok %i - %s = %.15g, want %.15g\n", ++check_count__, #actual, \ got__, want__); \ return (-1); \ -- 2.30.2