mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-29 03:21:05 +00:00
31 lines
770 B
Mathematica
31 lines
770 B
Mathematica
|
#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;
|
||
|
}
|
||
|
|