All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
UncopiableAndUnmovableClass_test.cc File Reference

Tests the content of UncopiableAndUnmovableClass.h. More...

#include "larcorealg/CoreUtils/UncopiableAndUnmovableClass.h"
#include <boost/test/unit_test.hpp>
#include <type_traits>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   ( UncopiableAndUnmovableClass_test )
 

Functions

 BOOST_AUTO_TEST_CASE (UncopiableAndUnmovableClassTest)
 

Detailed Description

Tests the content of UncopiableAndUnmovableClass.h.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov)
Date
April 28, 2016
See Also
larcorealg/CoreUtils/UncopiableAndUnmovableClass.h

This test takes no command line argument.

Definition in file UncopiableAndUnmovableClass_test.cc.

Macro Definition Documentation

#define BOOST_TEST_MODULE   ( UncopiableAndUnmovableClass_test )

Definition at line 19 of file UncopiableAndUnmovableClass_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( UncopiableAndUnmovableClassTest  )

Definition at line 55 of file UncopiableAndUnmovableClass_test.cc.

55  {
56 
57  // check lar::UncopiableAndUnmovableClass class itself
58  BOOST_TEST
60  BOOST_TEST
62  BOOST_TEST
64  BOOST_TEST
66 
67 
68  // check a class derived from lar::UncopiableAndUnmovableClass class
69  struct Derived: protected lar::UncopiableAndUnmovableClass {};
70 
75 
76 
77  // check a class derived from lar::UncopiableAndUnmovableClass class
78  // and made movable
79  struct MovableDerived: protected lar::UncopiableAndUnmovableClass {
80  MovableDerived(MovableDerived&&):
81  lar::UncopiableAndUnmovableClass() {}
82  };
83 
88 
89 
90  // check a class derived from lar::UncopiableAndUnmovableClass class
91  // and made both copy- and move-assignable
92  struct AssignableDerived: protected lar::UncopiableAndUnmovableClass {
93  AssignableDerived& operator=(AssignableDerived const&) { return *this; }
94  AssignableDerived& operator=(AssignableDerived&&) { return *this; }
95  };
96 
101 
102 } // BOOST_AUTO_TEST_CASE(UncopiableAndUnmovableClassTest)
An empty class that can&#39;t be copied nor moved.
UncopiableClass & operator=(UncopiableClass const &)=delete
temporary value