summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hořeňovský <martin.horenovsky@gmail.com>2019-10-21 18:31:05 +0200
committerMartin Hořeňovský <martin.horenovsky@gmail.com>2019-10-21 18:33:26 +0200
commit23c80bcc92c817d48699e667428d3501ff09598b (patch)
tree00163e04d26142e4c09e62394ab5b20a948aadd2
parenta2c8dce85c554aa30607914c57be300feaa3b05f (diff)
downloadcatch2-23c80bcc92c817d48699e667428d3501ff09598b.tar.gz
Provide workaround for platforms where INFINITY is double
Fixes #1782
-rw-r--r--include/internal/catch_matchers_floating.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/internal/catch_matchers_floating.cpp b/include/internal/catch_matchers_floating.cpp
index 68fd1bda..c226fc56 100644
--- a/include/internal/catch_matchers_floating.cpp
+++ b/include/internal/catch_matchers_floating.cpp
@@ -188,9 +188,10 @@ namespace Floating {
ret << ", ";
write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps));
} else {
- write(ret, step(static_cast<float>(m_target), -INFINITY, m_ulps));
+ // We have to cast INFINITY to float because of MinGW, see #1782
+ write(ret, step(static_cast<float>(m_target), static_cast<float>(-INFINITY), m_ulps));
ret << ", ";
- write(ret, step(static_cast<float>(m_target), INFINITY, m_ulps));
+ write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps));
}
ret << "])";