From: Florian Forster Date: Mon, 15 May 2017 15:25:44 +0000 (+0200) Subject: src/testing.h: Fix result of EXPECT_EQ_DOUBLE() when actual is NAN. X-Git-Tag: collectd-5.8.0~180 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f454d6080814b88cd02b3b7e11b2cdb743081b20;p=collectd.git src/testing.h: Fix result of EXPECT_EQ_DOUBLE() when actual is NAN. --- 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); \