72 CHECK (
getAdr (
this) ==
this);
73 CHECK (
getAdr (*
this) ==
this);
75 CStr aloof[2] = {
"reality",
"check"};
76 CHECK (
getAdr (aloof) == &aloof);
77 CHECK (
getAdr (&aloof[0]) == &aloof);
78 CHECK (
getAdr (&aloof[1]) == aloof+1);
79 CHECK (
getAdr ( aloof[0]) == aloof[0]);
80 CHECK (
getAdr ( aloof[1]) == aloof[1]);
110 size_t poo{
addrID (
this)};
113 static Boo* asBoo (
void* mem) {
return static_cast<Boo*
> (mem); }
125 Boo const*
const beep = boop;
126 CHECK (boo.moo != booo.moo);
127 CHECK (boo.moo == boop->moo);
136 CHECK (
isSameAdr (booo, asBoo(&booo.moo)));
137 CHECK (not
isSameAdr (booo, asBoo(&booo.woo)));
140 const void* voo = boop;
144 CHECK (
isSameAdr (voo, asBoo(&boo.moo)));
145 CHECK (not
isSameAdr (voo, asBoo(&booo.moo)));
146 CHECK (not
isSameAdr (voo, asBoo(&boo.woo)));
149 Boo&& roo = move(boo);
165 CHECK (
isSameAdr (sudo.poo, suBoo->poo));
196 Boo&& roo = move(boo);
const void * getAdr(X &x)
extract address but strip any type info
int rani(uint bound=_iBOUND())
void verify_isSameObject()
size_t addrID(X const &x)
generate an unique numeric ID based on the referred entity
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
bool isSameAdr(A const &a, B const &b)
compare plain object address identity, disregarding type.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...