mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
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:
parent
6b6b3d8e56
commit
a8d17e5179
5 changed files with 30 additions and 24 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue