forked from PurpleI2P/i2pd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add test for MergeChunkedResponse() (PurpleI2P#432)
- Loading branch information
hagen
committed
Jun 1, 2016
1 parent
ca2e148
commit 8589493
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <cassert> | ||
#include "../HTTP.h" | ||
|
||
using namespace i2p::http; | ||
|
||
int main() { | ||
const char *buf = | ||
"4\r\n" | ||
"HTTP\r\n" | ||
"A\r\n" | ||
" response \r\n" | ||
"E\r\n" | ||
"with \r\n" | ||
"chunks.\r\n" | ||
"0\r\n" | ||
"\r\n" | ||
; | ||
std::stringstream in(buf); | ||
std::stringstream out; | ||
|
||
assert(MergeChunkedResponse(in, out) == true); | ||
assert(out.str() == "HTTP response with \r\nchunks."); | ||
|
||
return 0; | ||
} |