mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-16 10:05:39 +02:00
Add stringification support to std::exception and deriving classes
This support is based on overriden `std::exception::what` method, so if an exception does not do so meaningfully, the message is still pointless. This is only used as a fallback, both `StringMaker` specialization and `operator<<` overload have priority..
This commit is contained in:
@@ -335,12 +335,12 @@ Matchers.tests.cpp:<line number>
|
||||
Matchers.tests.cpp:<line number>: FAILED:
|
||||
CHECK_THROWS_MATCHES( throws(3), SpecialException, ExceptionMatcher{1} )
|
||||
with expansion:
|
||||
{?} special exception has value of 1
|
||||
std::exception special exception has value of 1
|
||||
|
||||
Matchers.tests.cpp:<line number>: FAILED:
|
||||
REQUIRE_THROWS_MATCHES( throws(4), SpecialException, ExceptionMatcher{1} )
|
||||
with expansion:
|
||||
{?} special exception has value of 1
|
||||
std::exception special exception has value of 1
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Expected exceptions that don't throw or unexpected exceptions fail the test
|
||||
@@ -1084,6 +1084,6 @@ due to unexpected exception with message:
|
||||
Why would you throw a std::string?
|
||||
|
||||
===============================================================================
|
||||
test cases: 206 | 153 passed | 49 failed | 4 failed as expected
|
||||
assertions: 1061 | 933 passed | 107 failed | 21 failed as expected
|
||||
test cases: 207 | 154 passed | 49 failed | 4 failed as expected
|
||||
assertions: 1064 | 936 passed | 107 failed | 21 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user