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
Milestone
Comments
Agreed! |
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.
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.
The text was updated successfully, but these errors were encountered: