Skip to content

Commit

Permalink
Add test case for unhandled SEH exception
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
  • Loading branch information
Alan-Jowett committed Dec 17, 2021
1 parent 86e249e commit f923304
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/SelfTest/UsageTests/Misc.tests.cpp
Expand Up @@ -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

0 comments on commit f923304

Please sign in to comment.