improved use of developer testing conditionals

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32719 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-03-28 13:22:57 +00:00
parent 6b6b3d8e56
commit a8d17e5179
5 changed files with 30 additions and 24 deletions

View file

@ -1,14 +1,13 @@
#import <ObjectTesting.h>
#import "Testing.h"
#import <Foundation/NSObject.h>
#if defined(TESTDEV)
#if !__has_feature(objc_nonfragile_abi)
int main(void)
{
#if defined(TESTDEV)
START_SET("String throwing")
SKIP("Unified exception model not supported")
END_SET("String throwing");
#endif
return 0;
}
@ -23,7 +22,6 @@ int main(void)
*/
int main(void)
{
#if defined(TESTDEV)
NSString *foo = @"foo";
id caught = nil;
int final = 0;
@ -64,7 +62,11 @@ int main(void)
PASS(0==final, "catchall not used to catch object");
PASS(0==wrongCatch, "Incorrect object catch not used to catch object");
PASS(caught == foo, "Unified exception model works correctly");
#endif
return 0;
}
#else
int main(void)
{
return 0;
}
#endif

View file

@ -1,17 +1,13 @@
extern "C"
{
#import <ObjectTesting.h>
#import "Testing.h"
#import <Foundation/NSObject.h>
}
#if defined(TESTDEV)
#if !__has_feature(objc_nonfragile_abi)
int main(void)
{
#if defined(TESTDEV)
START_SET("String throwing")
SKIP("Unified exception model not supported")
END_SET("String throwing");
#endif
return 0;
}
@ -56,7 +52,6 @@ void testThrow(void)
*/
int main(void)
{
#if defined(TESTDEV)
testThrow();
PASS(0==final, "catchall not used to catch object");
PASS(caughtObj == nil, "Thrown string cast to NSObject matched NSObject (Apple mode)");
@ -69,7 +64,11 @@ int main(void)
PASS(caughtObj == foo, "Thrown string cast to NSObject matched NSObject (sane mode)");
PASS(caughtStr == nil, "Thrown string cast to NSObject matched NSString (sane mode)");
#endif
#endif
return 0;
}
#else
int main(void)
{
return 0;
}
#endif

View file

@ -1,14 +1,13 @@
#import <ObjectTesting.h>
#import "Testing.h"
#import <Foundation/NSObject.h>
#if defined(TESTDEV)
#if !__has_feature(objc_nonfragile_abi)
int main(void)
{
#if defined(TESTDEV)
START_SET("Unified exception model")
SKIP("Unified exception model not supported")
END_SET("Unified exception model")
#endif
return 0;
}
@ -26,7 +25,6 @@ int main(void)
*/
int main(void)
{
#if defined(TESTDEV)
NSString *foo = @"foo";
id caught = nil;
int final = 0;
@ -50,7 +48,11 @@ int main(void)
PASS(0==final, "catchall not used to catch object");
PASS(0==wrongCatch, "Incorrect object catch not used to catch object");
PASS(caught == foo, "Unified exception model works correctly");
#endif
return 0;
}
#else
int main(void)
{
return 0;
}
#endif

View file

@ -1,8 +1,7 @@
extern "C" {
#import "ObjectTesting.h"
#import "Testing.h"
#import <Foundation/Foundation.h>
}
#if defined(TESTDEV)
static int A_init;
static int B_init;
static int A_destroyed;
@ -66,13 +65,17 @@ class A1
@implementation C @end
int main(void)
{
#if defined(TESTDEV)
// Make sure constructors / destructors are called even without -init
[[C alloc] release];
// Reset state
A_init = B_init = A_destroyed = B_destroyed = 0;
// Check init is called in the middle
[[C new] release];
#endif
return 0;
}
#else
int main(void)
{
return 0;
}
#endif

View file

@ -1,5 +1,5 @@
#include "Testing.h"
#include <Foundation/Foundation.h>
#include "ObjectTesting.h"
@class NSAutoreleasePool;
int main()