Differences From Artifact [6a14912f05]:
- File
tests/OFHTTPClientTests.m
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 2910) [annotate] [blame] [check-ins using]
To Artifact [9c917ec780]:
- File tests/OFHTTPClientTests.m — part of check-in [c8f7b90082] at 2017-07-22 20:50:27 on branch trunk — Split OFDataArray into OFData and OFMutableData (user: js, size: 2900) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 | #import "OFHTTPResponse.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFThread.h" #import "OFCondition.h" #import "OFURL.h" #import "OFDictionary.h" | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #import "OFHTTPResponse.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFThread.h" #import "OFCondition.h" #import "OFURL.h" #import "OFDictionary.h" #import "OFData.h" #import "OFAutoreleasePool.h" #import "TestsAppDelegate.h" static OFString *module = @"OFHTTPClient"; static OFCondition *cond; |
︙ | ︙ | |||
89 90 91 92 93 94 95 | { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; HTTPClientTestsServer *server; OFURL *URL; OFHTTPClient *client; OFHTTPRequest *request; OFHTTPResponse *response = nil; | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; HTTPClientTestsServer *server; OFURL *URL; OFHTTPClient *client; OFHTTPRequest *request; OFHTTPResponse *response = nil; OFData *data; cond = [OFCondition condition]; [cond lock]; server = [[[HTTPClientTestsServer alloc] init] autorelease]; [server start]; |
︙ | ︙ | |||
113 114 115 116 117 118 119 | R(request = [OFHTTPRequest requestWithURL: URL]) && R(response = [client performRequest: request])) TEST(@"Normalization of server header keys", [[response headers] objectForKey: @"Content-Length"] != nil) TEST(@"Correct parsing of data", | | | | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | R(request = [OFHTTPRequest requestWithURL: URL]) && R(response = [client performRequest: request])) TEST(@"Normalization of server header keys", [[response headers] objectForKey: @"Content-Length"] != nil) TEST(@"Correct parsing of data", (data = [response readDataUntilEndOfStream]) && [data count] == 7 && memcmp([data items], "foo\nbar", 7) == 0) [server join]; [pool drain]; } @end |