ARC support for Object-C projects

This commit is contained in:
Phil Nash
2012-03-17 18:20:06 +00:00
parent 8d18d1648a
commit 53c990a7e1
9 changed files with 168 additions and 57 deletions

View File

@@ -193,6 +193,7 @@
4A63D2B014E3C1A900F615CB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -200,6 +201,7 @@
4A63D2B114E3C1A900F615CB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -223,6 +225,7 @@
4A63D2B114E3C1A900F615CB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};

View File

@@ -21,7 +21,7 @@
-(void) tearDown
{
[obj release];
arcSafeRelease( obj );
}
OC_TEST_CASE( "OCTest/test1", "This is a test case" )
@@ -41,6 +41,12 @@ OC_TEST_CASE( "OCTest/test2", "This is another test case" )
REQUIRE( obj.int_val == 2 );
}
///////////////////////////////////////////////////////////////////////////
template<typename T>
void useObject( const T& object ){}
template<typename T>
void useObject( const T* object ){}
using namespace Catch::Matchers;
OC_TEST_CASE( "OCTest/matchers", "Matches work with OC types (NSString so far)" )

View File

@@ -24,5 +24,5 @@ TEST_CASE( "OCTest/TestObj", "tests TestObj" )
REQUIRE( obj.int_val == 1 );
[obj release];
arcSafeRelease( obj );
}