mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-28 19:20:51 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32187 72102866-910b-0410-8b05-ffd578937521
30 lines
770 B
Objective-C
30 lines
770 B
Objective-C
#import <Foundation/Foundation.h>
|
|
#import "Testing.h"
|
|
|
|
int main()
|
|
{
|
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
|
BOOL ret;
|
|
NSLock *lock = [NSRecursiveLock new];
|
|
ret = [lock tryLock];
|
|
if (ret)
|
|
[lock unlock];
|
|
PASS(ret, "NSRecursiveLock with tryLock, then unlocking");
|
|
|
|
ASSIGN(lock,[NSRecursiveLock new]);
|
|
ret = [lock lockBeforeDate:[NSDate dateWithTimeIntervalSinceNow:1]];
|
|
if (ret)
|
|
[lock unlock];
|
|
PASS(ret, "NSRecursiveLock lockBeforeDate: works");
|
|
|
|
ASSIGN(lock,[NSRecursiveLock new]);
|
|
[lock tryLock];
|
|
ret = [lock lockBeforeDate:[NSDate dateWithTimeIntervalSinceNow:1]];
|
|
if (ret)
|
|
[lock unlock];
|
|
PASS(ret, "NSRecursiveLock lockBeforeDate: with NSRecursiveLock returns YES");
|
|
|
|
[arp release]; arp = nil;
|
|
return 0;
|
|
}
|
|
|