File: test-http-merge_chunked.cpp

package info (click to toggle)
i2pd 2.58.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,612 kB
  • sloc: cpp: 59,663; makefile: 224; sh: 138
file content (25 lines) | stat: -rw-r--r-- 410 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
}