Skip to content

Commit

Permalink
src/testing.h: Fix result of EXPECT_EQ_DOUBLE() when actual is NAN.
Browse files Browse the repository at this point in the history
  • Loading branch information
octo committed May 16, 2017
1 parent faf0576 commit 1b5d701
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/testing.h
Expand Up @@ -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); \
Expand Down

0 comments on commit 1b5d701

Please sign in to comment.