Skip to content
Prev Previous commit
Next Next commit
Applied new remove chunk markers option to tests.
  • Loading branch information
umennel committed Mar 31, 2018
commit 32cc7a155c32bd0ce212ae551bf8105dade03865
9 changes: 6 additions & 3 deletions libs/network/test/http/client_get_different_port_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ namespace http = boost::network::http;
TYPED_TEST_CASE(HTTPClientTest, ClientTypes);

TYPED_TEST(HTTPClientTest, GetDifferentPort) {
TypeParam client;
typename TypeParam::request r("http://www.boost.org:80/");
auto response_ = client.get(r);
using client = TypeParam;
typename client::options options;
options.remove_chunk_markers(true);
client client_;
typename TypeParam::request request("http://www.boost.org:80/");
auto response_ = client_.get(request);
auto range = headers(response_)["Content-Type"];
EXPECT_TRUE(std::begin(range) != std::end(range));
EXPECT_NE(0, body(response_).size());
Expand Down
5 changes: 4 additions & 1 deletion libs/network/test/http/client_get_streaming_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ TYPED_TEST(HTTPClientTest, GetStreamingTest) {
typename TypeParam::string_type dummy_body;
body_handler handler_instance(body_string);
{
TypeParam client_;
using client = TypeParam;
typename client::options options;
options.remove_chunk_markers(true);
client client_(options);
ASSERT_NO_THROW(response = client_.get(request, handler_instance));
auto range = headers(response)["Content-Type"];
ASSERT_TRUE(!boost::empty(range));
Expand Down
12 changes: 9 additions & 3 deletions libs/network/test/http/client_get_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ TYPED_TEST_CASE(HTTPClientTest, ClientTypes);
TYPED_TEST(HTTPClientTest, GetTest) {
using client = TypeParam;
typename client::request request("http://cpp-netlib.org/");
client client_;
typename client::options options;
options.remove_chunk_markers(true);
client client_(options);
typename client::response response;
ASSERT_NO_THROW(response = client_.get(request));
try {
Expand All @@ -34,7 +36,9 @@ TYPED_TEST(HTTPClientTest, GetTest) {
TYPED_TEST(HTTPClientTest, GetHTTPSTest) {
using client = TypeParam;
typename client::request request("https://www.github.com/");
client client_;
typename client::options options;
options.remove_chunk_markers(true);
client client_(options);
typename client::response response = client_.get(request);
EXPECT_TRUE(response.status() == 200 ||
(response.status() >= 300 && response.status() < 400));
Expand Down Expand Up @@ -77,7 +81,9 @@ TYPED_TEST(HTTPClientTest, TemporaryClientObjectTest) {
using client = TypeParam;
typename client::request request("http://cpp-netlib.org/");
typename client::response response;
ASSERT_NO_THROW(response = client().get(request));
typename client::options options;
options.remove_chunk_markers(true);
ASSERT_NO_THROW(response = client(options).get(request));
auto range = headers(response);
ASSERT_TRUE(!boost::empty(range));
try {
Expand Down