test-http-merge_chunked.cpp
1 #include <cassert> 2 #include "HTTP.h" 3 4 using namespace i2p::http; 5 6 int main() { 7 const char *buf = 8 "4\r\n" 9 "HTTP\r\n" 10 "A\r\n" 11 " response \r\n" 12 "E\r\n" 13 "with \r\n" 14 "chunks.\r\n" 15 "0\r\n" 16 "\r\n" 17 ; 18 std::stringstream in(buf); 19 std::stringstream out; 20 21 assert(MergeChunkedResponse(in, out) == true); 22 assert(out.str() == "HTTP response with \r\nchunks."); 23 24 return 0; 25 }