Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Create a template function for testing move and copy constructors in test utils #206

Closed
MauricioCarneiro opened this issue Aug 21, 2014 · 2 comments · Fixed by #213
Closed
Assignees

Comments

@MauricioCarneiro
Copy link
Contributor

Most classes support move and copy construction. Writing tests for it is repetitive and boring. A generic utility test function for that would simplify a lot.

@MauricioCarneiro MauricioCarneiro added this to the 1.0 milestone Aug 21, 2014
@MauricioCarneiro MauricioCarneiro self-assigned this Aug 21, 2014
@jmthibault79
Copy link
Contributor

Agreed!

@MauricioCarneiro
Copy link
Contributor Author

already implemented a few, looks like it's working well! It's in my branch now, will PR soon.

MauricioCarneiro pushed a commit that referenced this issue Aug 22, 2014
Testing move and copy operations are something we do all the time and
it's not always trivial. It includes a lot of boiler plate code. These
two template functions take away the boiler plate and test the following
aspects of the copy and move operations:

* copy and move construction
* copy and move assignment
* check that self assignment doesn't destroy the object

The copy version returns all three copies made to test the functionality.

The move version returns the final moved to object. Note that the move
function will move from the parameter passed in, so that parameter
becomes unusable.

fixes #206
MauricioCarneiro pushed a commit that referenced this issue Aug 22, 2014
Testing move and copy operations are something we do all the time and
it's not always trivial. It includes a lot of boiler plate code. These
two template functions take away the boiler plate and test the following
aspects of the copy and move operations:

* copy and move construction
* copy and move assignment
* check that self assignment doesn't destroy the object

The copy version returns all three copies made to test the functionality.

The move version returns the final moved to object. Note that the move
function will move from the parameter passed in, so that parameter
becomes unusable.

fixes #206
MauricioCarneiro pushed a commit that referenced this issue Aug 27, 2014
Testing move and copy operations are something we do all the time and
it's not always trivial. It includes a lot of boiler plate code. These
two template functions take away the boiler plate and test the following
aspects of the copy and move operations:

* copy and move construction
* copy and move assignment
* check that self assignment doesn't destroy the object

The copy version returns all three copies made to test the functionality.

The move version returns the final moved to object. Note that the move
function will move from the parameter passed in, so that parameter
becomes unusable.

fixes #206
MauricioCarneiro pushed a commit that referenced this issue Aug 27, 2014
Testing move and copy operations are something we do all the time and
it's not always trivial. It includes a lot of boiler plate code. These
two template functions take away the boiler plate and test the following
aspects of the copy and move operations:

* copy and move construction
* copy and move assignment
* check that self assignment doesn't destroy the object

The copy version returns all three copies made to test the functionality.

The move version returns the final moved to object. Note that the move
function will move from the parameter passed in, so that parameter
becomes unusable.

fixes #206
MauricioCarneiro pushed a commit that referenced this issue Aug 27, 2014
Testing move and copy operations are something we do all the time and
it's not always trivial. It includes a lot of boiler plate code. These
two template functions take away the boiler plate and test the following
aspects of the copy and move operations:

* copy and move construction
* copy and move assignment
* check that self assignment doesn't destroy the object

The copy version returns all three copies made to test the functionality.

The move version returns the final moved to object. Note that the move
function will move from the parameter passed in, so that parameter
becomes unusable.

fixes #206
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants