From f923304aceab14739f28d3c136202169465f5dce Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Fri, 17 Dec 2021 11:00:10 -0700 Subject: [PATCH] Add test case for unhandled SEH exception Signed-off-by: Alan Jowett --- tests/SelfTest/UsageTests/Misc.tests.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/SelfTest/UsageTests/Misc.tests.cpp b/tests/SelfTest/UsageTests/Misc.tests.cpp index 8fc61f0092..f7df7d91d0 100644 --- a/tests/SelfTest/UsageTests/Misc.tests.cpp +++ b/tests/SelfTest/UsageTests/Misc.tests.cpp @@ -526,9 +526,21 @@ void throw_and_catch() } } -TEST_CASE("Validate SEH behavior", "[approvals][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]") + +TEST_CASE("Validate SEH behavior - handled", "[approvals][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]") { // Validate that Catch2 framework correctly handles tests raising and handling SEH exceptions. throw_and_catch(); } + +void throw_no_catch() +{ + RaiseException(0xC0000005, 0, 0, NULL); +} + +TEST_CASE("Validate SEH behavior - unhandled", "[.approvals][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]") +{ + // Validate that Catch2 framework correctly handles tests raising and not handling SEH exceptions. + throw_no_catch(); +} #endif