add trivial https test

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36505 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2013-04-11 13:55:15 +00:00
parent 7f9100cb96
commit eccc43e0a2

View file

@ -8,6 +8,7 @@ int main()
NSMutableURLRequest *mutable;
NSURLConnection *connection;
NSURLResponse *response;
NSURLRequest *request;
NSError *error;
NSData *data;
NSURL *httpURL;
@ -36,7 +37,7 @@ int main()
error: &error];
PASS(data != nil && [data length] > 0,
"NSURLConnection synchronously load data from an http URL");
PASS(response != nil && [response statusCode] > 0,
PASS(response != nil && [(NSHTTPURLResponse*)response statusCode] > 0,
"NSURLConnection synchronous load returns a response");
path = [[NSFileManager defaultManager] currentDirectoryPath];
@ -48,6 +49,17 @@ int main()
PASS(data != nil && [data length] > 0,
"NSURLConnection synchronously load data from a local file");
request = [NSURLRequest requestWithURL:
[NSURL URLWithString:@"https://www.google.com/"]];
response = nil;
error = nil;
data = [NSURLConnection sendSynchronousRequest: request
returningResponse: &response
error: &error];
PASS(nil == error, "https://www.google.com/ does not return an error")
PASS(nil != data, "https://www.google.com/ returns data")
[arp release]; arp = nil;
return 0;
}