49 using std::make_shared;
51 using LERR_(ITER_EXHAUST);
52 using LERR_(INDEX_BOUNDS);
57 const uint NUM_ELMS = 10;
59 using Numz = vector<uint>;
68 for (uint i=0; i<NUM_ELMS; ++i)
105 Numz numz{makeNumz()};
108 CHECK (not isnil(i1));
112 for (uint i=*i1 ; i1; ++i1, ++i)
117 auto sum =
explore(Iter{numz}).resultSum();
118 uint n = numz.size() - 1;
119 CHECK (sum == n*(n+1)/2);
121 for (
auto & i : Iter{numz})
123 CHECK (join(numz,
"◇") ==
"1◇2◇3◇4◇5◇6◇7◇8◇9◇10"_expect);
140 Numz numz{makeNumz()};
146 CHECK (not isnil(
iter));
147 CHECK (join(
iter) ==
"4, 5, 6, 7, 8, 9"_expect);
151 CHECK (4 ==
iter.getIDX());
153 CHECK (7 ==
iter.getIDX());
154 CHECK (not isnil(
iter));
159 CHECK (join(
iter) ==
"6, 7, 8, 9"_expect);
169 CHECK (not isnil(
iter));
173 CHECK (9 ==
iter.getIDX());
175 CHECK (9 ==
iter.getIDX());
186 auto smartNumz = make_shared<Numz> (makeNumz());
187 Numz & numz{*smartNumz};
188 Numz
const& const_numz{numz};
191 for (Iter
iter{numz};
196 CHECK (
iter != Iter());
199 CHECK (*
iter == i-1);
203 for (CIter
iter{const_numz};
208 CHECK (
iter != CIter());
209 CHECK (*
iter == i-1);
216 CHECK (1 == smartNumz.use_count());
218 SMIter smIter{smartNumz};
219 CIter cIter{*smartNumz};
220 CHECK (*cIter == uint(-1));
221 for (i=0; smIter; ++smIter, ++i)
224 CHECK (smIter != SMIter());
225 CHECK (*smIter == i-1);
227 CHECK (*smIter == i);
229 CHECK (isnil (smIter));
230 CHECK (smIter == SMIter());
233 CHECK (*smIter == *cIter);
238 CHECK (2 == smartNumz.use_count());
240 CHECK (1 == smartNumz.use_count());
263 CHECK (i1 == i2); CHECK (i2 == i1);
264 CHECK (i1 != iN); CHECK (iN != i1);
265 CHECK (i2 != iN); CHECK (iN != i2);
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
Iterator-style access handle to a referred container with subscript index.
void verifyComparisons(IT const &ii)
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Subscript-index based access to a container, packaged as iterator.
void iterTypeVariations()
Implementation namespace for support and library code.
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.
Building tree expanding and backtracking evaluations within hierarchical scopes.
void verify_randomAccess()