From 68595a949364af4faac7b4aa6855d11b015c752e Mon Sep 17 00:00:00 2001 From: Joe Ranweiler Date: Wed, 14 Feb 2018 10:10:51 -0800 Subject: [PATCH] Fix handling of test failures due to uncaught exceptions We don't just want to exit here, but `longjmp()` back to the conditional via a call to `DeepState_Fail()`. In doing so, we end up in the common `DeepState_CatchFail()` branch, which exits with the same nonzero error code, but also saves the test case if appropriate. --- src/include/deepstate/DeepState.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/deepstate/DeepState.h b/src/include/deepstate/DeepState.h index dff969e..7194376 100644 --- a/src/include/deepstate/DeepState.h +++ b/src/include/deepstate/DeepState.h @@ -423,7 +423,7 @@ static void DeepState_RunTest(struct DeepState_TestInfo *test) { #if defined(__cplusplus) && defined(__cpp_exceptions) } catch(...) { - exit(1); + DeepState_Fail(); } #endif /* __cplusplus */