mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 21:35:40 +02:00
Fix bad error reporting for nested exceptions in default configuration
Bad handling of `TestFailureException` when translating unexpected exceptions inside assertion macros led to the unexpected exceptions handling erroring out through throwing the same exception again. This was then backstopped by the machinery for handling uncaught exceptions from assertions, which is normally used by the `CATCH_CONFIG_FAST_COMPILE` machinery, where we assume that it can only be invoked because the assertion macros are not configured to catch assertions. Closes #1292
This commit is contained in:
@@ -52,6 +52,20 @@ TEST_CASE("failing test") {
|
||||
}
|
||||
```
|
||||
|
||||
Same applies for a `SKIP` nested inside an assertion:
|
||||
|
||||
```cpp
|
||||
static bool do_skip() {
|
||||
SKIP();
|
||||
return true;
|
||||
}
|
||||
|
||||
TEST_CASE("Another failing test") {
|
||||
CHECK(do_skip());
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Interaction with Sections and Generators
|
||||
|
||||
Sections, nested sections as well as specific outputs from [generators](generators.md#top)
|
||||
|
Reference in New Issue
Block a user