mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
7f9100cb96
commit
eccc43e0a2
1 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue