mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +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
dff5311a0b
commit
2c42f05b7f
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>
|
||||
|
||||
* Source/NSObject.m (__builtin_offsetof): Add
|
||||
|
|
|
@ -113,10 +113,12 @@ int main(void)
|
|||
*/
|
||||
PASS(1, "initialize test starts");
|
||||
|
||||
#if defined(SIGALRM)
|
||||
/* End in a signal if the concurrency test deadlocks.
|
||||
*/
|
||||
signal(SIGALRM, alarmed);
|
||||
alarm(5);
|
||||
#endif
|
||||
|
||||
l = [NSCondition new];
|
||||
[l lock];
|
||||
|
|
|
@ -2,6 +2,13 @@
|
|||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSString.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
|
||||
{
|
||||
Class class;
|
||||
|
@ -23,11 +30,14 @@
|
|||
info = theInfo;
|
||||
}
|
||||
@end
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
id evilObject;
|
||||
|
||||
#if defined(GNUSTEP_BASE_LIBRARY)
|
||||
PASS([NSObject isClass] &&
|
||||
[NSString isClass] &&
|
||||
[NSArray isClass],
|
||||
|
@ -42,6 +52,7 @@ int main()
|
|||
[evilObject setInfo:1];
|
||||
PASS(![evilObject isClass],
|
||||
"-isClass returns NO on an instance (special test for broken libobjc)");
|
||||
#endif
|
||||
|
||||
PASS(([[[NSObject new] autorelease] isKindOfClass:[NSObject class]] &&
|
||||
[[[NSString new] autorelease] isKindOfClass:[NSString class]] &&
|
||||
|
|
Loading…
Reference in a new issue