Fix the hotfix:
commit a62f12a8a3ca3a36fdac8b8b0414cb6a0bed01f1
Author: Salvage <29021710+Saalvage@users.noreply.github.com>
Date: Wed Jan 12 02:08:14 2022 +0100
Fix throwing
commit 5f40d27903048037752d78af92876bffd2f82dcb
Author: Salvage <29021710+Saalvage@users.noreply.github.com>
Date: Wed Jan 12 01:51:17 2022 +0100
Suppress more warnings
commit 6082269701220995688f2d57a54e0dd864f795fa
Author: Salvage <29021710+Saalvage@users.noreply.github.com>
Date: Wed Jan 12 01:36:28 2022 +0100
Suppress warnings
commit 8c3dc33998bba9a65bfc626002e35cc7ee64c948
Author: Salvage <29021710+Saalvage@users.noreply.github.com>
Date: Wed Jan 12 01:18:54 2022 +0100
Fix various errors
diff --git a/examples/all_features/assertion_macros.cpp b/examples/all_features/assertion_macros.cpp
index 6ad8287..cd03dd1 100644
--- a/examples/all_features/assertion_macros.cpp
+++ b/examples/all_features/assertion_macros.cpp
@@ -202,27 +202,29 @@
if (CHECK_UNARY_FALSE(a != b)) { MESSAGE(":D"); }
}
+DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4702)
TEST_CASE("check return values") {
comp(0, 0);
- if (CHECK_THROWS([] { throw 2; }())) { MESSAGE(":D"); }
- if (CHECK_THROWS_AS([] { throw 2; }(), int)) { MESSAGE(":D"); }
- if (CHECK_NOTHROW([] { }())) { MESSAGE(":D"); }
- if (CHECK_THROWS_WITH([] { throw 2; }(), "2")) { MESSAGE(":D"); }
+ if (CHECK_THROWS(throw_if(true, true))) { MESSAGE(":D"); }
+ if (CHECK_THROWS_AS(throw_if(true, 2), int)) { MESSAGE(":D"); }
+ if (CHECK_NOTHROW(throw_if(false, 2))) { MESSAGE(":D"); }
+ if (CHECK_THROWS_WITH(throw_if(true, 2), "2")) { MESSAGE(":D"); }
if (CHECK_NAN(std::numeric_limits<float>::quiet_NaN())) { MESSAGE(":D"); }
- if (CHECK_NOT_NAN(2'2.)) { MESSAGE(":D"); }
+ if (CHECK_NOT_NAN(22.)) { MESSAGE(":D"); }
}
TEST_CASE("check return values no print") {
comp(4, 2);
- if (CHECK_THROWS([] { }())) { MESSAGE(":D"); }
- if (CHECK_THROWS_AS([] { throw 2; }(), doctest::Approx)) { MESSAGE(":D"); }
- if (CHECK_NOTHROW([] { throw 2; }())) { MESSAGE(":D"); }
- if (CHECK_THROWS_WITH([] { throw 2; }(), "1")) { MESSAGE(":D"); }
+ if (CHECK_THROWS(throw_if(false, false))) { MESSAGE(":D"); }
+ if (CHECK_THROWS_AS(throw_if(true, 2), doctest::Approx)) { MESSAGE(":D"); }
+ if (CHECK_NOTHROW(throw_if(true, 2))) { MESSAGE(":D"); }
+ if (CHECK_THROWS_WITH(throw_if(true, 2), "1")) { MESSAGE(":D"); }
if (CHECK_NAN(0.)) { MESSAGE(":D"); }
- if (CHECK_NOT_NAN(std::numeric_limits<long double>::signaling_NaN())) { MESSAGE(":D"); }
+ // CHECK_NOT_NAN can't be checked because stringification is (partly) implementation defined
}
+DOCTEST_MSVC_SUPPRESS_WARNING_POP
TEST_CASE("nan") {
REQUIRE_NOT_NAN(0.f);