Fix test if exceptions are not supported
This commit is contained in:
		
							parent
							
								
									fe1b2563ab
								
							
						
					
					
						commit
						e9a2da4cf8
					
				@ -213,6 +213,7 @@ TEST(NiceMockTest, AllowsExpectedCall) {
 | 
				
			|||||||
// the method.
 | 
					// the method.
 | 
				
			||||||
TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes) {
 | 
					TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes) {
 | 
				
			||||||
	NiceMock<MockFoo> nice_foo;
 | 
						NiceMock<MockFoo> nice_foo;
 | 
				
			||||||
 | 
					#if GTEST_HAS_EXCEPTIONS
 | 
				
			||||||
	try	{
 | 
						try	{
 | 
				
			||||||
		nice_foo.ReturnSomething();
 | 
							nice_foo.ReturnSomething();
 | 
				
			||||||
		FAIL();
 | 
							FAIL();
 | 
				
			||||||
@ -220,6 +221,11 @@ TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes) {
 | 
				
			|||||||
		const std::string exception_msg(ex.what());
 | 
							const std::string exception_msg(ex.what());
 | 
				
			||||||
		EXPECT_NE(exception_msg.find("ReturnSomething"), std::string::npos);
 | 
							EXPECT_NE(exception_msg.find("ReturnSomething"), std::string::npos);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
						EXPECT_DEATH_IF_SUPPORTED({
 | 
				
			||||||
 | 
							nice_foo.ReturnSomething();
 | 
				
			||||||
 | 
						}, "");
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Tests that an unexpected call on a nice mock fails.
 | 
					// Tests that an unexpected call on a nice mock fails.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user