Added support for Objective-C exceptions

This commit is contained in:
Phil Nash
2012-05-21 21:51:16 +01:00
parent 371db8b42f
commit 35b31fa78a
3 changed files with 40 additions and 0 deletions

View File

@@ -41,6 +41,18 @@ OC_TEST_CASE( "OCTest/test2", "This is another test case" )
REQUIRE( obj.int_val == 2 );
}
OC_TEST_CASE( "OCTest/throws/objc", "throws an Objective-C exception" )
{
@throw [[NSException alloc] initWithName: NSGenericException
reason: @"Objective-C exception"
userInfo: nil];
}
OC_TEST_CASE( "OCTest/throws/stdc++", "throws a std c++ exception" )
{
throw std::domain_error( "std C++ exception" );
}
///////////////////////////////////////////////////////////////////////////
template<typename T>
void useObject( const T& object ){}