23 #ifndef LIB_TEST_TRACKING_DUMMY_H 24 #define LIB_TEST_TRACKING_DUMMY_H 53 static bool _throw_in_ctor;
62 : val_{1 +
rani (100
'000'000)}
76 operator= (
Dummy && oDummy)
103 checksum() += newVal - val_;
110 std::swap (dum1.val_, dum2.val_);
120 activateCtorFailure (
bool indeed =
true)
122 _throw_in_ctor = indeed;
148 static constexpr
int DEFUNCT = std::numeric_limits<int>::min();
149 static constexpr
int DEAD = std::numeric_limits<int>::max();
155 log.
call (
this,
"dtor", val);
162 log.
call (
this,
"ctor");
168 log.
call (
this,
"ctor", v);
174 log.
call (
this,
"ctor-copy", ol);
180 log.
call (
this,
"ctor-move", oo);
187 if (util::isSameObject (*
this, ol))
189 log.
call (
this,
"self-assign-copy");
193 log.
call (
this,
"assign-copy", ol);
202 if (util::isSameObject (*
this, oo))
204 log.
call (
this,
"self-assign-move");
208 log.
call (
this,
"assign-move", oo);
215 operator string()
const 223 log.
call (
"static",
"swap", t1, t2);
224 std::swap (t1.val, t2.val);
static long _local_checksum
to verify ctor/dtor calls
Types marked with this mix-in may be moved and move-assigned.
Support for verifying the occurrence of events from unit tests.
Helper to log and verify the occurrence of events.
int rani(uint bound=_iBOUND())
A front-end for using printf-style formatting.
virtual long calc(int i)
a dummy API operation
friend void swap(Dummy &dum1, Dummy &dum2)
Implementation namespace for support and library code.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
A tracking Dummy object for tests.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
EventLog & call(string target, string function)
Log occurrence of a function call with no arguments.
A Dummy object for tests.
Generating (pseudo) random numbers with controlled seed.