60 Tracker() : i_(rand() % 500) { ++cntTracker; }
62 Tracker(uint i) : i_(i) { ++cntTracker; }
69 using Tracker::Tracker;
75 bool operator!= (
Tracker const& t1,
Tracker const& t2) {
return t1.i_ != t2.i_; }
104 ulong l1 (1 + rand() % 1000);
105 ulong l2 (1 + rand() % 1000);
106 string s1 (randStr(50));
107 string s2 (randStr(50));
108 const char* cp (s1.c_str());
110 Time t1{randTime()}, t2{randTime()};
111 Duration d1{randTime()}, d2{randTime()};
113 verifyUsage<ulong> (l1, l2);
114 verifyUsage<ulong*> (&l1, &l2);
116 verifyUsage<string> (s1, s2);
117 verifyUsage<string*> (&s1, &s2);
119 verifyUsage<string> (s2, cp);
120 verifyUsage<string> (cp,
"Lumiera");
121 verifyUsage<const char*> (cp,
"Lumiera");
124 verifyUsage<Time> (t1, t2);
125 verifyUsage<Time> (t1, d1);
126 verifyUsage<Duration> (d1, t2);
127 verifyUsage<Duration> (d1, d2);
129 verifyNonComparableElements();
130 verifyOnlyMoveConstructible();
131 verifySaneInstanceHandling();
136 template<
typename X,
typename Y>
138 verifyUsage (X she, Y he)
146 CHECK (
sizeof(
one) ==
sizeof(X));
147 CHECK (
sizeof(
two) ==
sizeof(X));
152 CHECK (
one == copy1);
153 CHECK (
one != copy2);
154 CHECK (
two != copy1);
155 CHECK (
two != copy2);
160 CHECK (
one == copy1);
161 CHECK (
one != copy2);
162 CHECK (
two != copy1);
163 CHECK (
two == copy2);
165 std::swap (copy1, copy2);
166 CHECK (
one != copy1);
167 CHECK (
one == copy2);
168 CHECK (
two == copy1);
169 CHECK (
two != copy2);
175 CHECK (copy2 == she);
198 verifyUsage<Tracker> (t1, t2);
199 verifyUsage<Tracker*> (&t1, &t2);
200 verifyUsage<Tracker> (t1, t2.i_);
201 verifyUsage<Tracker, Tracker&> (t1, t2);
205 verifyUsage<NonAssign> (u1, u2);
206 verifyUsage<NonAssign*> (&u1, &u2);
207 verifyUsage<NonAssign> (u1, u2.i_);
208 verifyUsage<NonAssign, NonAssign&> (u1, u2);
209 verifyUsage<Tracker> (u1, u2);
211 CHECK (2 == cntTracker);
221 CHECK (ptrWrap.get() == NULL);
224 CHECK (5 == *ptrWrap.get());
225 CHECK (&x == ptrWrap.get());
230 CHECK ( isSameObject (*ptrWrap.get(), x));
231 CHECK (!isSameObject ( ptrWrap.get(), x));
242 int i = -10 + rand() % 21;
253 CHECK (i == w2.get().i);
254 CHECK (j == w1.get().i);
271 int i = -10 + rand() % 21;
273 Cagey(Cagey && privy)
279 Cagey(Cagey
const&) =
default;
284 uc2 {std::move (Cagey{})};
291 CHECK (i == uc2.get().i);
292 CHECK (j == uc1.get().i);
295 CHECK (j == occult.get().i);
void verifySaneInstanceHandling()
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.
Simple 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, bypassing any custom comparison operators.