mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
* update tests
This commit is contained in:
parent
2ce61402bb
commit
b68f06ca83
4 changed files with 22 additions and 4 deletions
|
@ -3,11 +3,12 @@
|
|||
|
||||
using namespace i2p::http;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
HTTPRes *res;
|
||||
int ret = 0, len = 0;
|
||||
const char *buf;
|
||||
|
||||
/* test: parsing valid response without body */
|
||||
buf =
|
||||
"HTTP/1.1 304 Not Modified\r\n"
|
||||
"Date: Thu, 14 Apr 2016 00:00:00 GMT\r\n"
|
||||
|
@ -31,6 +32,18 @@ int main(int argc, char *argv[]) {
|
|||
assert(res->length() == 536);
|
||||
delete res;
|
||||
|
||||
/* test: building request */
|
||||
buf =
|
||||
"HTTP/1.0 304 Not Modified\r\n"
|
||||
"Content-Length: 0\r\n"
|
||||
"\r\n";
|
||||
res = new HTTPRes;
|
||||
res->version = "HTTP/1.0";
|
||||
res->code = 304;
|
||||
res->status = "Not Modified";
|
||||
res->add_header("Content-Length", "0");
|
||||
assert(res->to_string() == buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue