mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
Auto registers OC Classes
This commit is contained in:
@@ -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
|
@@ -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" )
|
||||
|
@@ -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 );
|
||||
|
||||
|
Reference in New Issue
Block a user