[go: up one dir, main page]

File: testurl.m

package info (click to toggle)
libfoundation1.0 1.0.84-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,132 kB
  • ctags: 1,584
  • sloc: objc: 41,781; ansic: 3,935; sh: 2,979; perl: 171; makefile: 71
file content (32 lines) | stat: -rw-r--r-- 692 bytes parent folder | download
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
/*
  Checks some URL parsing methods.
*/

#include <Foundation/Foundation.h>

static void test(void) {
  NSString *s;
  NSURL    *u;
  
  s = @"http://localhost:80/imap/user@imaphost/blah/blub";
  u = [NSURL URLWithString:s];
  NSLog(@"compare:\n  str: %@\n  url: %@", s, u);
  
  s = @"http://localhost/imap/user@imaphost/blah/blub";
  u = [NSURL URLWithString:s];
  NSLog(@"compare:\n  str: %@\n  url: %@", s, u);
}

int main(int argc, char **argv, char **env) {
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

#if LIB_FOUNDATION_LIBRARY
  [NSProcessInfo initializeWithArguments:argv count:argc environment:env];
#endif

  test();

  [pool release];
  exit(0);
  return 0;
}