mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-12 00:51:08 +00:00
Make test usable on MinGW
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33783 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8da720fc7a
commit
04e6ab22d9
3 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2011-08-25 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Tests/base/NSObject/test01.m: Only test for -isClass on GNUstep base.
|
||||||
|
* Tests/base/NSObject/initialize.m: Make test compile on MinGW.
|
||||||
|
|
||||||
2011-08-22 Fred Kiefer <FredKiefer@gmx.de>
|
2011-08-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSObject.m (__builtin_offsetof): Add
|
* Source/NSObject.m (__builtin_offsetof): Add
|
||||||
|
|
|
@ -113,10 +113,12 @@ int main(void)
|
||||||
*/
|
*/
|
||||||
PASS(1, "initialize test starts");
|
PASS(1, "initialize test starts");
|
||||||
|
|
||||||
|
#if defined(SIGALRM)
|
||||||
/* End in a signal if the concurrency test deadlocks.
|
/* End in a signal if the concurrency test deadlocks.
|
||||||
*/
|
*/
|
||||||
signal(SIGALRM, alarmed);
|
signal(SIGALRM, alarmed);
|
||||||
alarm(5);
|
alarm(5);
|
||||||
|
#endif
|
||||||
|
|
||||||
l = [NSCondition new];
|
l = [NSCondition new];
|
||||||
[l lock];
|
[l lock];
|
||||||
|
|
|
@ -2,6 +2,13 @@
|
||||||
#import <Foundation/NSAutoreleasePool.h>
|
#import <Foundation/NSAutoreleasePool.h>
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
|
|
||||||
|
#if defined(GNUSTEP_BASE_LIBRARY)
|
||||||
|
@interface NSObject (ISCLASS)
|
||||||
|
// This method doesn't exist on Cocoa
|
||||||
|
- (BOOL) isClass;
|
||||||
|
@end
|
||||||
|
|
||||||
@interface MyEvilClass : NSObject
|
@interface MyEvilClass : NSObject
|
||||||
{
|
{
|
||||||
Class class;
|
Class class;
|
||||||
|
@ -23,11 +30,14 @@
|
||||||
info = theInfo;
|
info = theInfo;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
#endif
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||||
id evilObject;
|
id evilObject;
|
||||||
|
|
||||||
|
#if defined(GNUSTEP_BASE_LIBRARY)
|
||||||
PASS([NSObject isClass] &&
|
PASS([NSObject isClass] &&
|
||||||
[NSString isClass] &&
|
[NSString isClass] &&
|
||||||
[NSArray isClass],
|
[NSArray isClass],
|
||||||
|
@ -42,6 +52,7 @@ int main()
|
||||||
[evilObject setInfo:1];
|
[evilObject setInfo:1];
|
||||||
PASS(![evilObject isClass],
|
PASS(![evilObject isClass],
|
||||||
"-isClass returns NO on an instance (special test for broken libobjc)");
|
"-isClass returns NO on an instance (special test for broken libobjc)");
|
||||||
|
#endif
|
||||||
|
|
||||||
PASS(([[[NSObject new] autorelease] isKindOfClass:[NSObject class]] &&
|
PASS(([[[NSObject new] autorelease] isKindOfClass:[NSObject class]] &&
|
||||||
[[[NSString new] autorelease] isKindOfClass:[NSString class]] &&
|
[[[NSString new] autorelease] isKindOfClass:[NSString class]] &&
|
||||||
|
|
Loading…
Reference in a new issue