Skip to content

Commit c4d758a

Browse files
committed
Applied new remove chunk markers option to tests.
1 parent 673b853 commit c4d758a

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

libs/network/test/http/client_get_different_port_test.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ namespace http = boost::network::http;
1515
TYPED_TEST_CASE(HTTPClientTest, ClientTypes);
1616

1717
TYPED_TEST(HTTPClientTest, GetDifferentPort) {
18-
TypeParam client;
19-
typename TypeParam::request r("http://www.boost.org:80/");
20-
auto response_ = client.get(r);
18+
using client = TypeParam;
19+
typename client::options options;
20+
options.remove_chunk_markers(true);
21+
client client_;
22+
typename TypeParam::request request("http://www.boost.org:80/");
23+
auto response_ = client_.get(request);
2124
auto range = headers(response_)["Content-Type"];
2225
EXPECT_TRUE(std::begin(range) != std::end(range));
2326
EXPECT_NE(0, body(response_).size());

libs/network/test/http/client_get_streaming_test.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ TYPED_TEST(HTTPClientTest, GetStreamingTest) {
3232
typename TypeParam::string_type dummy_body;
3333
body_handler handler_instance(body_string);
3434
{
35-
TypeParam client_;
35+
using client = TypeParam;
36+
typename client::options options;
37+
options.remove_chunk_markers(true);
38+
client client_(options);
3639
ASSERT_NO_THROW(response = client_.get(request, handler_instance));
3740
auto range = headers(response)["Content-Type"];
3841
ASSERT_TRUE(!boost::empty(range));

libs/network/test/http/client_get_test.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ TYPED_TEST_CASE(HTTPClientTest, ClientTypes);
1515
TYPED_TEST(HTTPClientTest, GetTest) {
1616
using client = TypeParam;
1717
typename client::request request("http://cpp-netlib.org/");
18-
client client_;
18+
typename client::options options;
19+
options.remove_chunk_markers(true);
20+
client client_(options);
1921
typename client::response response;
2022
ASSERT_NO_THROW(response = client_.get(request));
2123
try {
@@ -34,7 +36,9 @@ TYPED_TEST(HTTPClientTest, GetTest) {
3436
TYPED_TEST(HTTPClientTest, GetHTTPSTest) {
3537
using client = TypeParam;
3638
typename client::request request("https://www.github.com/");
37-
client client_;
39+
typename client::options options;
40+
options.remove_chunk_markers(true);
41+
client client_(options);
3842
typename client::response response = client_.get(request);
3943
EXPECT_TRUE(response.status() == 200 ||
4044
(response.status() >= 300 && response.status() < 400));
@@ -52,7 +56,9 @@ TYPED_TEST(HTTPClientTest, TemporaryClientObjectTest) {
5256
using client = TypeParam;
5357
typename client::request request("http://cpp-netlib.org/");
5458
typename client::response response;
55-
ASSERT_NO_THROW(response = client().get(request));
59+
typename client::options options;
60+
options.remove_chunk_markers(true);
61+
ASSERT_NO_THROW(response = client(options).get(request));
5662
auto range = headers(response);
5763
ASSERT_TRUE(!boost::empty(range));
5864
try {

0 commit comments

Comments
 (0)