mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Calls method of FatalConditionHandler (to avoid warnings)
This commit is contained in:
parent
8ec9a5a547
commit
b1936d3b0e
@ -58,14 +58,22 @@ namespace Catch {
|
|||||||
fatal( "<unknown signal>", -sig );
|
fatal( "<unknown signal>", -sig );
|
||||||
}
|
}
|
||||||
|
|
||||||
FatalConditionHandler() {
|
FatalConditionHandler() : m_isSet( true ) {
|
||||||
for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i )
|
for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i )
|
||||||
signal( signalDefs[i].id, handleSignal );
|
signal( signalDefs[i].id, handleSignal );
|
||||||
}
|
}
|
||||||
~FatalConditionHandler() {
|
~FatalConditionHandler() {
|
||||||
for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i )
|
reset();
|
||||||
signal( signalDefs[i].id, SIG_DFL );
|
|
||||||
}
|
}
|
||||||
|
void reset() {
|
||||||
|
if( m_isSet ) {
|
||||||
|
for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i )
|
||||||
|
signal( signalDefs[i].id, SIG_DFL );
|
||||||
|
m_isSet = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool m_isSet;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Catch
|
} // namespace Catch
|
||||||
|
@ -296,6 +296,7 @@ namespace Catch {
|
|||||||
void invokeActiveTestCase() {
|
void invokeActiveTestCase() {
|
||||||
FatalConditionHandler fatalConditionHandler; // Handle signals
|
FatalConditionHandler fatalConditionHandler; // Handle signals
|
||||||
m_activeTestCase->invoke();
|
m_activeTestCase->invoke();
|
||||||
|
fatalConditionHandler.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user