Skip to content

Commit dddc187

Browse files
committed
Add unit test for http::request::swap
1 parent 90ab5bc commit dddc187

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

http/test/request_test.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ TEST(message_test, request_construction) {
1919
http::request other(request);
2020
}
2121

22+
TEST(message_test, request_swap) {
23+
network::uri tmp_uri;
24+
network::uri request_uri("http://www.google.com/");
25+
network::uri other_uri("http://www.google.it/");
26+
http::request request(request_uri);
27+
http::request other(other_uri);
28+
29+
request.swap(other);
30+
31+
request.get_uri(tmp_uri);
32+
ASSERT_EQ(tmp_uri, other_uri);
33+
other.get_uri(tmp_uri);
34+
ASSERT_EQ(tmp_uri, request_uri);
35+
}
36+
2237
TEST(message_test, request_value_semantics) {
2338
// First let's default construct a request.
2439
http::request original;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy