File: connection.m

package info (click to toggle)
gnustep-base 1.31.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,580 kB
  • sloc: objc: 239,446; ansic: 36,519; cpp: 122; sh: 112; makefile: 100; xml: 32
file content (36 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import "Testing.h"
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSBundle.h>
#import <Foundation/NSConnection.h>
#import <Foundation/NSException.h>
#import <Foundation/NSFileManager.h>
#import <Foundation/NSString.h>

int main()
{
  NSAutoreleasePool   *arp = [NSAutoreleasePool new];
  NSBundle *bundle;
  NSString *bundlePath = [[NSFileManager defaultManager] currentDirectoryPath];
  bundlePath = [bundlePath stringByAppendingPathComponent: @"Resources"];
  bundlePath = [NSBundle pathForResource: @"TestConnection" 
                   		  ofType: @"bundle"
			     inDirectory: bundlePath];
  bundle = [NSBundle bundleWithPath: bundlePath];
  PASS([bundle load],"We can load the test bundle");
  {
    /* this should probably be rewritten to uh return a bool */
    NS_DURING
      NSDate *date;
      NSRunLoop *run = [NSRunLoop currentRunLoop];
      [NSClassFromString(@"Tester") performSelector: @selector(startup)];
    
      date = [NSDate dateWithTimeIntervalSinceNow: 3.0];
      [run runUntilDate: date];
      PASS(1, "NSConnection can do a simple connection");
    NS_HANDLER
      PASS(0, "NSConnection can do a simple connection");
    NS_ENDHANDLER
  }
  [arp release]; arp = nil;
  return 0;
}