Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/UsageTests
diff options
context:
space:
mode:
authorKochetkov, Yuriy2022-03-02 15:42:07 +0300
committerMartin Hořeňovský2022-03-24 15:49:02 +0100
commitcf6dd937ab2ff62d29b34d62411cfd03d3822021 (patch)
tree0d9996de379fc995f31eda8aac7653296fc1d942 /tests/SelfTest/UsageTests
parent2ce64d1d8f265bba48f3b7bb2130d0cfbfb51ed4 (diff)
downloadcatch3-cf6dd937ab2ff62d29b34d62411cfd03d3822021.tar.gz
Add test for `FatalConditionHandler` and stack unwinding
Signed-off-by: Kochetkov, Yuriy <yuriyx.kochetkov@intel.com>
Diffstat (limited to 'tests/SelfTest/UsageTests')
-rw-r--r--tests/SelfTest/UsageTests/Misc.tests.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/SelfTest/UsageTests/Misc.tests.cpp b/tests/SelfTest/UsageTests/Misc.tests.cpp
index cf608dd9..33734d43 100644
--- a/tests/SelfTest/UsageTests/Misc.tests.cpp
+++ b/tests/SelfTest/UsageTests/Misc.tests.cpp
@@ -537,4 +537,16 @@ TEST_CASE("Validate SEH behavior - unhandled", "[.approvals][FatalConditionHandl
// Validate that Catch2 framework correctly handles tests raising and not handling SEH exceptions.
throw_no_catch();
}
+
+static LONG CALLBACK dummyExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) {
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
+TEST_CASE("Validate SEH behavior - no crash for stack unwinding", "[approvals][!throws][!shouldfail][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]")
+{
+ // Trigger stack unwinding with SEH top-level filter changed and validate the test fails expectedly with no application crash
+ SetUnhandledExceptionFilter(dummyExceptionFilter);
+ throw 1;
+}
+
#endif