Skip to content

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

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