MCPcopy Create free account
hub / github.com/apache/mesos / TEST

Function TEST

3rdparty/libprocess/src/tests/decoder_tests.cpp:153–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153TEST(DecoderTest, Response)
154{
155 ResponseDecoder decoder;
156
157 const string data =
158 "HTTP/1.1 200 OK\r\n"
159 "Date: Fri, 31 Dec 1999 23:59:59 GMT\r\n"
160 "Content-Type: text/plain\r\n"
161 "Content-Length: 2\r\n"
162 "\r\n"
163 "hi";
164
165 deque<http::Response*> responses = decoder.decode(data.data(), data.length());
166 ASSERT_FALSE(decoder.failed());
167 ASSERT_EQ(1u, responses.size());
168
169 Owned<http::Response> response(responses[0]);
170
171 EXPECT_EQ("200 OK", response->status);
172 EXPECT_EQ(http::Response::BODY, response->type);
173 EXPECT_EQ("hi", response->body);
174
175 EXPECT_EQ(3u, response->headers.size());
176}
177
178
179TEST(DecoderTest, ResponseWithUnspecifiedLength)

Callers

nothing calls this directly

Calls 12

dataMethod · 0.80
writingBodyMethod · 0.80
isReadyMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
decodeMethod · 0.45
failedMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
getMethod · 0.45
readMethod · 0.45
isPendingMethod · 0.45

Tested by

no test coverage detected