36using LERR_(WRONG_TYPE);
76 virtual operator string()
const =0;
87 static_assert (0 < i,
"invalid construction");
104 virtual operator string()
const override
106 return _Fmt(
"Sub|%s|%d|-%s")
107 % util::typeStr(
this)
123 _CheckSum_ -= access();
127 access() =
'A' +
rani(23);
128 _CheckSum_ += access();
132 access() =
osub.access();
133 _CheckSum_ += access();
138 std::swap(access(),
rsub.access());
145 _CheckSum_ -= access();
146 access() =
osub.access();
147 _CheckSum_ += access();
154 _CheckSum_ -= access();
156 std::swap(access(),
rsub.access());
214 throw error::Logic{
"virtual copy works only on instances "
215 "of the same concrete implementation class"
216 ,
LERR_(WRONG_TYPE)};
248 CHECK(0 == _CheckSum_);
252 CHECK(0 == _CheckSum_);
259 CHECK(0 == _CheckSum_);
289 CHECK (
string(a) ==
string(
aa));
290 CHECK (
string(a) ==
string(
a1));
296 CHECK (
string(a) ==
string(
aa));
310 UnAssignable<
'C'>
cc(c);
312 CHECK (
string(c) ==
string(
cc));
315 UnAssignable<
'C'>
ccc(std::move(
cc));
330 OnlyMovable<
'D'>
dd (std::move(
d));
360 RegularImpl a,
aa,
aaa;
365 char storage[
sizeof(RegularImpl)];
366 Interface&
iiii (*
reinterpret_cast<Interface*
> (&storage));
371 i.moveInto(&storage);
379 CHECK (
string(i) ==
string(ii));
394 cout <<
"==fullVirtualCopySupport=="<<endl
408 ClonableImpl b,
bb,
bbb;
413 char storage[
sizeof(ClonableImpl)];
414 Interface&
iiii (*
reinterpret_cast<Interface*
> (&storage));
419 i.moveInto(&storage);
427 ii.copyInto(&storage);
440 cout <<
"==noAssignementSupport=="<<endl
458 char storage[
sizeof(MovableImpl)];
459 Interface&
iiii (*
reinterpret_cast<Interface*
> (&storage));
464 i.moveInto(&storage);
477 cout <<
"==onlyMovableSupport=="<<endl
493 char storage[
sizeof(ImobileImpl)];
506 cout <<
"==disabledCopySupport=="<<endl
A front-end for using printf-style formatting.
Implementation namespace for support and library code.
int rani(uint bound=_iBOUND())
LumieraError< LERR_(LOGIC)> Logic
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Helper for building »virtual copy« operations.