Differences From Artifact [f46357cbad]:
- File tests/OFHTTPClientTests.m — part of check-in [2b7a70e246] at 2012-12-09 12:13:28 on branch trunk — Split OFHTTPRequest into OFHTTP{Client,Request}. (user: js, size: 2736) [annotate] [blame] [check-ins using]
To Artifact [01c0783752]:
- File
tests/OFHTTPClientTests.m
— part of check-in
[75f187cef5]
at
2012-12-26 20:55:27
on branch trunk
— OFHTTPRequestResult -> OFHTTPRequestReply.
The class also has its own file now. (user: js, size: 2784) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include <string.h> #include <time.h> #include <assert.h> #import "OFHTTPClient.h" #import "OFHTTPRequest.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFThread.h" #import "OFCondition.h" #import "OFURL.h" #import "OFDictionary.h" #import "OFAutoreleasePool.h" | > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #include <string.h> #include <time.h> #include <assert.h> #import "OFHTTPClient.h" #import "OFHTTPRequest.h" #import "OFHTTPRequestReply.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFThread.h" #import "OFCondition.h" #import "OFURL.h" #import "OFDictionary.h" #import "OFAutoreleasePool.h" |
︙ | ︙ | |||
91 92 93 94 95 96 97 | @implementation TestsAppDelegate (OFHTTPClientests) - (void)HTTPClientTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFHTTPClientTestsServer *server; OFURL *url; OFHTTPClient *client; | | | | | | | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | @implementation TestsAppDelegate (OFHTTPClientests) - (void)HTTPClientTests { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFHTTPClientTestsServer *server; OFURL *url; OFHTTPClient *client; OFHTTPRequest *request; OFHTTPRequestReply *reply; cond = [OFCondition condition]; [cond lock]; server = [[[OFHTTPClientTestsServer alloc] init] autorelease]; [server start]; [cond wait]; [cond unlock]; url = [OFURL URLWithString: [OFString stringWithFormat: @"http://127.0.0.1:%" @PRIu16 "/foo", server->port]]; TEST(@"-[performRequest:]", R(client = [OFHTTPClient client]) && R(request = [OFHTTPRequest requestWithURL: url]) && R(reply = [client performRequest: request])) TEST(@"Normalization of server header keys", ([[reply headers] objectForKey: @"Content-Length"] != nil)) [server join]; [pool drain]; } @end |