mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
iHacks for MacOS-X compatibility
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14322 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1d13da9cdf
commit
a312d7cec7
3 changed files with 64 additions and 15 deletions
|
@ -3,12 +3,42 @@
|
|||
|
||||
|
||||
#if 1
|
||||
|
||||
static void test1(void)
|
||||
{
|
||||
NSURL *baseURL = [NSURL fileURLWithPath:@"/usr/local/bin"];
|
||||
NSURL *url = [NSURL URLWithString:@"filename" relativeToURL:baseURL];
|
||||
NSString *result = [url absoluteString];
|
||||
NSString *expected = @"file:/usr/local/bin/filename";
|
||||
|
||||
if ([result isEqualToString:expected])
|
||||
NSLog(@"test 1 ok");
|
||||
else
|
||||
NSLog(@"-[NSURL absoluteString] returned \"%@\", expected \"%@\"", result, expected);
|
||||
}
|
||||
|
||||
static void test2(void)
|
||||
{
|
||||
NSURL *url = [NSURL fileURLWithPath:@"/tmp/foo"];
|
||||
NSString *result = [url path];
|
||||
NSString *expected = @"/tmp/foo";
|
||||
|
||||
if ([result isEqualToString:expected])
|
||||
NSLog(@"Test 2 ok");
|
||||
else
|
||||
NSLog(@"-[NSURL path] returned \"%@\", expected \"%@\"", result, expected);
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
id pool = [NSAutoreleasePool new];
|
||||
id o = [NSObject new];
|
||||
NSArray *a = [NSArray arrayWithObjects: @"a", @"b", nil];
|
||||
|
||||
|
||||
test1();
|
||||
test2();
|
||||
|
||||
printf ("Hello from object at 0x%x\n", (unsigned)[o self]);
|
||||
|
||||
NSLog(@"Value for foo is %@", [a valueForKey: @"foo"]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue