Clear log stream before failing with longjmp in fatal log
When an assertion fails in the C++ API, it ultimately invokes a `Fatal`-level `DeepState_Log()`. This calls `DeepState_Fail()`, which longjmps. If we don't clear the log buffer here, it won't get cleared by the usual logic which does so. This causes hanging, unflushed log messages to persist between tests. This relationship should eventually be inverted and decoupled.
This commit is contained in:
parent
4a90b2a5e8
commit
d81cbba137
@ -77,6 +77,9 @@ void DeepState_Log(enum DeepState_LogLevel level, const char *str) {
|
||||
if (DeepState_LogError == level) {
|
||||
DeepState_SoftFail();
|
||||
} else if (DeepState_LogFatal == level) {
|
||||
/* `DeepState_Fail()` calls `longjmp()`, so we need to make sure
|
||||
* we clean up the log buffer first. */
|
||||
DeepState_ClearStream(level);
|
||||
DeepState_Fail();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user