Auto registers OC Classes

This commit is contained in:
Phil Nash
2010-11-16 07:00:08 +00:00
parent d52f61cc67
commit f59ecbcad6
4 changed files with 71 additions and 53 deletions

View File

@@ -11,14 +11,9 @@
#import <Cocoa/Cocoa.h>
#import "TestObj.h"
@interface TestFixture : NSObject
@interface TestFixture : NSObject <OcFixture>
{
TestObj* obj;
}
@end
CATCH_REGISTER_CLASS( TestFixture )
@end

View File

@@ -12,20 +12,14 @@
@implementation TestFixture
- (id) init
-(void) setUp
{
self = [super init];
if (self != nil)
{
obj = [[TestObj alloc] init];
}
return self;
obj = [[TestObj alloc] init];
}
- (void) dealloc
-(void) tearDown
{
[obj release];
[super dealloc];
}
OC_TEST_CASE( "OCTest/test1", "This is a test case" )

View File

@@ -3,9 +3,12 @@
#import "CatchOCTestCase.h"
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Catch::registerTestMethods();
// insert code here...
int result = Catch::Main( argc, (char* const*)argv );