mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Add test for FatalConditionHandler and stack unwinding
				
					
				
			Signed-off-by: Kochetkov, Yuriy <yuriyx.kochetkov@intel.com>
This commit is contained in:
		 Kochetkov, Yuriy
					Kochetkov, Yuriy
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							2ce64d1d8f
						
					
				
				
					commit
					cf6dd937ab
				
			| @@ -537,4 +537,16 @@ TEST_CASE("Validate SEH behavior - unhandled", "[.approvals][FatalConditionHandl | ||||
|     // Validate that Catch2 framework correctly handles tests raising and not handling SEH exceptions. | ||||
|     throw_no_catch(); | ||||
| } | ||||
|  | ||||
| static LONG CALLBACK dummyExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) { | ||||
|     return EXCEPTION_CONTINUE_SEARCH; | ||||
| } | ||||
|  | ||||
| TEST_CASE("Validate SEH behavior - no crash for stack unwinding", "[approvals][!throws][!shouldfail][FatalConditionHandler][CATCH_PLATFORM_WINDOWS]") | ||||
| { | ||||
|     // Trigger stack unwinding with SEH top-level filter changed and validate the test fails expectedly with no application crash | ||||
|     SetUnhandledExceptionFilter(dummyExceptionFilter); | ||||
|     throw 1; | ||||
| } | ||||
|  | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user