Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
IterTools_test Class Reference

Description

Test:
build combined and filtering iterators with the help of lib::IterTool. Check correct behaviour of the resulting iterators and verify they fulfil the Lumiera Forward Iterator concept
Todo:
implement more iterator tools.... see Ticket #347

Definition at line 81 of file itertools-test.cpp.

Private Types

typedef TestSource::iterator Iter
 

Private Member Functions

virtual void run (Arg arg)
 
template<class IT >
void pullOut (IT const &ii)
 
void buildFilterIterator (Iter const &ii)
 
void verify_filterExtension ()
 
void verify_filterRepetitions ()
 
void buildWrappedSingleElement ()
 
void buildTransformingIterator (Iter const &ii)
 
template<class IT >
void verifyComparisons (IT const &ii)
 
void verifyPullLast (Iter const &ii)
 

Static Private Member Functions

static bool takeAll (int)
 
static bool takeOdd (int i)
 
static bool takeEve (int i)
 
static bool takeTrd (int i)
 
static ulong addTwo (int i)
 
static int negate (int i)
 
static int idFunc (int i)
 

Private Attributes

uint NUM_ELMS {0}
 

Member Typedef Documentation

◆ Iter

typedef TestSource::iterator Iter
private

Definition at line 84 of file itertools-test.cpp.

Member Function Documentation

◆ run()

virtual void run ( Arg  arg)
inlineprivatevirtual

◆ pullOut()

template<class IT >
void pullOut ( IT const &  ii)
inlineprivate

Definition at line 118 of file itertools-test.cpp.

Referenced by IterTools_test::buildFilterIterator(), IterTools_test::buildTransformingIterator(), IterTools_test::run(), and IterTools_test::verify_filterExtension().

+ Here is the caller graph for this function:

◆ takeAll()

static bool takeAll ( int  )
inlinestaticprivate

Definition at line 127 of file itertools-test.cpp.

Referenced by IterTools_test::buildFilterIterator(), and IterTools_test::verify_filterExtension().

+ Here is the caller graph for this function:

◆ takeOdd()

static bool takeOdd ( int  i)
inlinestaticprivate

Definition at line 128 of file itertools-test.cpp.

Referenced by IterTools_test::buildFilterIterator().

+ Here is the caller graph for this function:

◆ takeEve()

static bool takeEve ( int  i)
inlinestaticprivate

Definition at line 129 of file itertools-test.cpp.

Referenced by IterTools_test::buildFilterIterator(), and IterTools_test::verify_filterExtension().

+ Here is the caller graph for this function:

◆ takeTrd()

static bool takeTrd ( int  i)
inlinestaticprivate

Definition at line 130 of file itertools-test.cpp.

Referenced by IterTools_test::verify_filterExtension().

+ Here is the caller graph for this function:

◆ buildFilterIterator()

void buildFilterIterator ( Iter const &  ii)
inlineprivate

Definition at line 133 of file itertools-test.cpp.

References lib::filterIterator(), IterTools_test::pullOut(), IterTools_test::takeAll(), IterTools_test::takeEve(), IterTools_test::takeOdd(), and IterTools_test::verifyComparisons().

Referenced by IterTools_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_filterExtension()

void verify_filterExtension ( )
inlineprivate
Test:
verify the ability to extend a filter condition while in the middle of an ongoing iteration. Typically this means sharpening the filter condition and thus making the filter more restrictive, filtering away more elements of the source stream. But through the ability to add disjunctive and negated clauses, it is also possible to weaken the filter condition
Note
in case of a weakened filter condition, there is no reset of the source iterator, i.e. we don't re-evaluate from start, but just from current head.

Definition at line 165 of file itertools-test.cpp.

References IterTools_test::NUM_ELMS, IterTools_test::pullOut(), IterTools_test::takeAll(), IterTools_test::takeEve(), IterTools_test::takeTrd(), and IterTools_test::verifyComparisons().

Referenced by IterTools_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_filterRepetitions()

void verify_filterRepetitions ( )
inlineprivate
Test:
verify the helper to filter duplicate elements emitted by an source iterator. This test creates a sequence of numbers with random repetitions.

Definition at line 233 of file itertools-test.cpp.

References lib::filterRepetitions(), IterTools_test::NUM_ELMS, and lib::rani().

Referenced by IterTools_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildWrappedSingleElement()

void buildWrappedSingleElement ( )
inlineprivate
Test:
wrap an arbitrary single element as pseudo-iterator

Definition at line 265 of file itertools-test.cpp.

References lib::singleValIterator(), and VERIFY_ERROR.

Referenced by IterTools_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTwo()

static ulong addTwo ( int  i)
inlinestaticprivate

Definition at line 305 of file itertools-test.cpp.

Referenced by IterTools_test::buildTransformingIterator().

+ Here is the caller graph for this function:

◆ negate()

static int negate ( int  i)
inlinestaticprivate

Definition at line 306 of file itertools-test.cpp.

Referenced by IterTools_test::buildTransformingIterator().

+ Here is the caller graph for this function:

◆ idFunc()

static int idFunc ( int  i)
inlinestaticprivate

Definition at line 307 of file itertools-test.cpp.

Referenced by IterTools_test::buildTransformingIterator().

+ Here is the caller graph for this function:

◆ buildTransformingIterator()

void buildTransformingIterator ( Iter const &  ii)
inlineprivate

Definition at line 310 of file itertools-test.cpp.

References IterTools_test::addTwo(), IterTools_test::idFunc(), IterTools_test::negate(), IterTools_test::pullOut(), lib::transformIterator(), and IterTools_test::verifyComparisons().

Referenced by IterTools_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verifyComparisons()

template<class IT >
void verifyComparisons ( IT const &  ii)
inlineprivate
Test:
verify equality handling and NIL detection for the given iterator/wrapper handed in

Definition at line 339 of file itertools-test.cpp.

Referenced by IterTools_test::buildFilterIterator(), IterTools_test::buildTransformingIterator(), IterTools_test::run(), and IterTools_test::verify_filterExtension().

+ Here is the caller graph for this function:

◆ verifyPullLast()

void verifyPullLast ( Iter const &  ii)
inlineprivate

Definition at line 374 of file itertools-test.cpp.

References lib::pull_last(), and VERIFY_ERROR.

Referenced by IterTools_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ NUM_ELMS

+ Inheritance diagram for IterTools_test:
+ Collaboration diagram for IterTools_test:

The documentation for this class was generated from the following file: