diff options
author | Stefan <29021710+Saalvage@users.noreply.github.com> | 2022-01-11 21:35:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-11 21:35:14 +0300 |
commit | 8acee4fa084d3e16b08a6c9bb5c37340cb7fcbb6 (patch) | |
tree | 768dc1715058fef7d5ce3792b71f7cb7f54c83f7 /scripts | |
parent | 23d3e5d75d9e37188d489f7dd44dbe096cb6c06e (diff) |
Nan check (#582)
* CHECK_NAN (Resolves #105)
* Fix helper macro
* Include correct test header
* Move definitions to cpp file
* Extern declaration and exception fix
* Fix more warnings
* Warning suppression
* Add NaN checking docs
* Improved wording
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/coverage_maxout.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/coverage_maxout.cpp b/scripts/coverage_maxout.cpp index ed3b4fb0..8b6e574f 100644 --- a/scripts/coverage_maxout.cpp +++ b/scripts/coverage_maxout.cpp @@ -15,6 +15,7 @@ int throw_if(bool in, const T& ex) { DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <ostream> #include <sstream> +#include <stdexcept> DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END #ifndef DOCTEST_CONFIG_DISABLE @@ -94,7 +95,11 @@ TEST_CASE("exercising tricky code paths of doctest") { // trigger code path for String to ostream through operator<< oss << str; // trigger code path for assert string of a non-existent assert type - oss << assertString(static_cast<assertType::Enum>(3)); +#ifndef DOCTEST_CONFIG_NO_EXCEPTIONS + try { + assertString(static_cast<assertType::Enum>(3)); + } catch (const std::logic_error&) { } +#endif str += oss.str().c_str(); str += failureString(assertType::is_normal); CHECK(str == "omgomgomgaaaNULLtrue00.5f0.50.199991111111true0.50.50.1cc" |