MCPcopy Create free account
hub / github.com/aria2/aria2 / testClearField

Method testClearField

test/HttpHeaderTest.cc:154–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void HttpHeaderTest::testClearField()
155{
156 HttpHeader h;
157 h.setStatusCode(200);
158 h.setVersion("HTTP/1.1");
159 h.put(HttpHeader::LINK, "Bar");
160
161 CPPUNIT_ASSERT_EQUAL(std::string("Bar"), h.find(HttpHeader::LINK));
162
163 h.clearField();
164
165 CPPUNIT_ASSERT_EQUAL(std::string(""), h.find(HttpHeader::LINK));
166 CPPUNIT_ASSERT_EQUAL(200, h.getStatusCode());
167 CPPUNIT_ASSERT_EQUAL(std::string("HTTP/1.1"), h.getVersion());
168}
169
170void HttpHeaderTest::testFieldContains()
171{

Callers

nothing calls this directly

Calls 6

setStatusCodeMethod · 0.80
clearFieldMethod · 0.80
setVersionMethod · 0.45
putMethod · 0.45
findMethod · 0.45
getStatusCodeMethod · 0.45

Tested by

no test coverage detected