52 Tracker(uint i) : i_(i) { ++cntTracker; }
59 using Tracker::Tracker;
65 bool operator!= (
Tracker const& t1,
Tracker const& t2) {
return t1.i_ != t2.i_; }
95 ulong l1 (1 +
rani(1000));
96 ulong l2 (1 +
rani(1000));
97 string s1 (randStr(50));
98 string s2 (randStr(50));
99 const char* cp (s1.c_str());
101 Time t1{randTime()}, t2{randTime()};
102 Duration d1{randTime()}, d2{randTime()};
104 verifyUsage<ulong> (l1, l2);
105 verifyUsage<ulong*> (&l1, &l2);
107 verifyUsage<string> (s1, s2);
108 verifyUsage<string*> (&s1, &s2);
110 verifyUsage<string> (s2, cp);
111 verifyUsage<string> (cp,
"Lumiera");
112 verifyUsage<const char*> (cp,
"Lumiera");
115 verifyUsage<Time> (t1, t2);
116 verifyUsage<Time> (t1, d1);
117 verifyUsage<Duration> (d1, t2);
118 verifyUsage<Duration> (d1, d2);
120 verifyNonComparableElements();
121 verifyOnlyMoveConstructible();
122 verifySaneInstanceHandling();
127 template<
typename X,
typename Y>
129 verifyUsage (X she, Y he)
137 CHECK (
sizeof(
one) ==
sizeof(X));
138 CHECK (
sizeof(
two) ==
sizeof(X));
143 CHECK (
one == copy1);
144 CHECK (
one != copy2);
145 CHECK (
two != copy1);
146 CHECK (
two != copy2);
151 CHECK (
one == copy1);
152 CHECK (
one != copy2);
153 CHECK (
two != copy1);
154 CHECK (
two == copy2);
156 std::swap (copy1, copy2);
157 CHECK (
one != copy1);
158 CHECK (
one == copy2);
159 CHECK (
two == copy1);
160 CHECK (
two != copy2);
166 CHECK (copy2 == she);
189 verifyUsage<Tracker> (t1, t2);
190 verifyUsage<Tracker*> (&t1, &t2);
191 verifyUsage<Tracker> (t1, t2.i_);
192 verifyUsage<Tracker, Tracker&> (t1, t2);
196 verifyUsage<NonAssign> (u1, u2);
197 verifyUsage<NonAssign*> (&u1, &u2);
198 verifyUsage<NonAssign> (u1, u2.i_);
199 verifyUsage<NonAssign, NonAssign&> (u1, u2);
200 verifyUsage<Tracker> (u1, u2);
202 CHECK (2 == cntTracker);
212 CHECK (ptrWrap.get() == NULL);
215 CHECK (5 == *ptrWrap.get());
216 CHECK (&x == ptrWrap.get());
221 CHECK ( isSameObject (*ptrWrap.get(), x));
222 CHECK (!isSameObject ( ptrWrap.get(), x));
233 int i = -10 +
rani(21);
244 CHECK (i == w2.get().i);
245 CHECK (j == w1.get().i);
262 int i = -10 +
rani(21);
264 Cagey(Cagey && privy)
270 Cagey(Cagey
const&) =
default;
275 uc2 {std::move (Cagey{})};
282 CHECK (i == uc2.get().i);
283 CHECK (j == uc1.get().i);
286 CHECK (j == occult.get().i);
void verifySaneInstanceHandling()
int rani(uint bound=_iBOUND())
bool operator==(PtrDerefIter< I1 > const &il, PtrDerefIter< I2 > const &ir)
Supporting equality comparisons...
Singleton holder for NIL or default value objects.
Implementation namespace for support and library code.
string randStr(size_t len)
create garbage string of given length
Lumiera's internal time value datatype.
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A collection of frequently used helper functions to support unit testing.
void verifyOnlyMoveConstructible()
ExampleStrategy::Qualifier two(string additionalArg)
definition of another qualifier two(arg), accepting an additional argument
Adapter container to take snapshots from non-assignable values.
Duration is the internal Lumiera time metric.
lib::time::Time randTime()
create a random but not insane Time value between 1s ...
void verifyNonComparableElements()
ExampleStrategy::Qualifier one()
definition of a qualifier one()
a family of time value like entities and their relationships.
Adapter wrapper to treat non-assignable values as if they were assignable.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...