Macros | Functions
UncopiableAndUnmovableClass_test.cc File Reference
#include "CoreUtils/UncopiableAndUnmovableClass.h"
#include <cetlib/quiet_unit_test.hpp>
#include <boost/test/test_tools.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)
 

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 33 of file UncopiableAndUnmovableClass_test.cc.

33  {
34 
35  // check gar::UncopiableAndUnmovableClass class itself
36  BOOST_CHECK
38  BOOST_CHECK
40  BOOST_CHECK
42  BOOST_CHECK
44 
45 
46  // check a class derived from gar::UncopiableAndUnmovableClass class
47  struct Derived: protected gar::UncopiableAndUnmovableClass {};
48 
53 
54 
55  // check a class derived from gar::UncopiableAndUnmovableClass class
56  // and made movable
57  struct MovableDerived: protected gar::UncopiableAndUnmovableClass {
58  MovableDerived(MovableDerived&&):
59  gar::UncopiableAndUnmovableClass() {}
60  };
61 
66 
67 
68  // check a class derived from gar::UncopiableAndUnmovableClass class
69  // and made both copy- and move-assignable
70  struct AssignableDerived: protected gar::UncopiableAndUnmovableClass {
71  AssignableDerived& operator=(AssignableDerived const&) { return *this; }
72  AssignableDerived& operator=(AssignableDerived&&) { return *this; }
73  };
74 
79 
80 } // BOOST_AUTO_TEST_CASE(larProviderFromTest)
General GArSoft Utilities.
An empty class that can&#39;t be copied nor moved.