Skip to content

request_value_semantics test failed #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 23, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add unit test for http::request::swap
  • Loading branch information
nico159 committed May 18, 2013
commit dddc187d5dd252f7b1dae24aec79cffc17aebe51
15 changes: 15 additions & 0 deletions http/test/request_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ TEST(message_test, request_construction) {
http::request other(request);
}

TEST(message_test, request_swap) {
network::uri tmp_uri;
network::uri request_uri("http://www.google.com/");
network::uri other_uri("http://www.google.it/");
http::request request(request_uri);
http::request other(other_uri);

request.swap(other);

request.get_uri(tmp_uri);
ASSERT_EQ(tmp_uri, other_uri);
other.get_uri(tmp_uri);
ASSERT_EQ(tmp_uri, request_uri);
}

TEST(message_test, request_value_semantics) {
// First let's default construct a request.
http::request original;
Expand Down