mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Added signal handlers (and placeholder for SEH handlers)
- based on PR 232 (https://github.com/philsquared/Catch/pull/232 - thanks Lukasz Forynski) - Writes to reporter, so gets all the usual context, but then exits directly (since the stack cannot be resumed) so no summary - On Windows does nothing, as yet.
This commit is contained in:
@@ -380,3 +380,9 @@ TEST_CASE( "toString on wchar_t returns the string contents", "[toString]" ) {
|
||||
std::string result = Catch::toString( s );
|
||||
CHECK( result == "\"wide load\"" );
|
||||
}
|
||||
|
||||
TEST_CASE( "Divide by Zero signal handler", "[.][sig]" ) {
|
||||
int i = 0;
|
||||
int x = 10/i; // This should cause the signal to fire
|
||||
CHECK( x == 0 );
|
||||
}
|
||||
|
Reference in New Issue
Block a user