bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ 101221 ] NSURL bugs


From: nobody
Subject: [ 101221 ] NSURL bugs
Date: Fri, 23 Aug 2002 15:49:33 -0400

Support Request #101221, was updated on 2002-Aug-23 15:49
You can respond by visiting: 
http://savannah.gnu.org/support/?func=detailsupport&support_id=101221&group_id=99

Category: Foundation
Status: Open
Priority: 5
Summary: NSURL bugs

By: lcampbel
Date: 2002-Aug-23 15:49
Logged In: NO 
Browser: Mozilla/4.5 (compatible; OmniWeb/4.1-v422; Mac_PowerPC)

The following code illustrates two bugs in the NSURL implementation in 
gnustep-base-1.4.0. These two examples work fine on MacOS X 10.1.5.


#import <Foundation/Foundation.h>

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://localhost/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(int argc, const char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    test1();
    test2();

    [pool release];
    return 0;
}


----------------------------------------------------------------------
You can respond by visiting: 
http://savannah.gnu.org/support/?func=detailsupport&support_id=101221&group_id=99




reply via email to

[Prev in Thread] Current Thread [Next in Thread]