~ubuntu-branches/ubuntu/wily/gnustep-base/wily

« back to all changes in this revision

Viewing changes to Tests/base/NSLock/RecursiveLock.m

  • Committer: Package Import Robot
  • Author(s): Yavor Doganov
  • Date: 2011-09-15 12:31:15 UTC
  • mfrom: (1.2.11 upstream) (8.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20110915123115-rmvsia9z0211izvq
Tags: 1.22.1-1
* New upstream release:
  + Fixes implicit declaration of function (Closes: #629216).
* debian/rules (v_make): Set to 2.6.1.
  (install-common): Do not delete non-existent .swp file.
* debian/control.m4 (Build-Depends): Remove gobjc; gnustep-make now
  depends on it.
  (libgnustep-base-dev) <Depends>: Likewise.
  (Suggests): Remove; completely pointless.
* debian/control: Regenerate.
* debian/patches/avoid-nsl-linkage.patch: Refresh.
* debian/patches/autoreconf.patch: Regenerate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#import <Foundation/Foundation.h>
 
2
#import "Testing.h"
 
3
 
 
4
int main()
 
5
{
 
6
  NSAutoreleasePool   *arp = [NSAutoreleasePool new];
 
7
  BOOL ret;
 
8
  NSLock *lock = [NSRecursiveLock new];
 
9
  ret = [lock tryLock];
 
10
  if (ret)
 
11
    [lock unlock];
 
12
  PASS(ret, "NSRecursiveLock with tryLock, then unlocking");
 
13
  
 
14
  ASSIGN(lock,[NSRecursiveLock new]);
 
15
  ret = [lock lockBeforeDate:[NSDate dateWithTimeIntervalSinceNow:1]];
 
16
  if (ret)
 
17
    [lock unlock];
 
18
  PASS(ret, "NSRecursiveLock lockBeforeDate: works");
 
19
  
 
20
  ASSIGN(lock,[NSRecursiveLock new]);
 
21
  [lock tryLock];
 
22
  ret = [lock lockBeforeDate:[NSDate dateWithTimeIntervalSinceNow:1]];
 
23
  if (ret)
 
24
    [lock unlock];
 
25
  PASS(ret, "NSRecursiveLock lockBeforeDate: with NSRecursiveLock returns YES");
 
26
 
 
27
  [arp release]; arp = nil;
 
28
  return 0;
 
29
}
 
30