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

request_value_semantics test failed #238

merged 4 commits into from
May 23, 2013

Conversation

nico159
Copy link

@nico159 nico159 commented May 18, 2013

[ RUN ] message_test.request_value_semantics
/home/nico159/cpp-netlib/http/test/request_test.cpp:42: Failure
Value of: copy != assigned
Actual: false
Expected: true
[ FAILED ] message_test.request_value_semantics (28 ms)

The current implementation in request of swap and equals is:

  // Then we lift the swap and equals implementation.
  using request_base::swap;
  using request_base::equals;

But it's not good, as they don't care about request_pimpl in http::request
So I defined swap and equals for request (and also added an unit test for swap)

I'm a bit unsure if this it the correct way to fix the unit test

@@ -161,6 +161,15 @@ request& request::operator=(request rhs) {
return *this;
}

void request::swap(request& other ) {
std::swap(pimpl_, other.pimpl_);
request_storage_base::swap(other);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost, but not quite. It should probably look like this:

using std::swap;
swap(pimpl_, other.pimpl_);
request_storage_base::swap(other);

@deanberris
Copy link
Member

Just address the above comment, and it should be good to go -- good job! 👍

@nico159
Copy link
Author

nico159 commented May 22, 2013

Ok, done

@deanberris
Copy link
Member

LGTM

deanberris added a commit that referenced this pull request May 23, 2013
request_value_semantics test failed
@deanberris deanberris merged commit 185da8a into cpp-netlib:master May 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants