Lumiera  0.pre.03
»edit your freedom«
ItemWrapper_test Class Reference

Description

Test:
use the ItemWrapper to define inline-storage holding values, pointers and references.

Verify correct behaviour in each case, including (self)assignment, empty check, invalid dereferentiation.

See also
wrapper.hpp

Definition at line 97 of file item-wrapper-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void verifyFunctionRefResult ()
 
void verifyFunctionResult ()
 
void verifySaneInstanceHandling ()
 
void verifySaneMoveHandling ()
 
void verifyWrappedRef ()
 
template<typename X >
void verifyWrapper (X val, X otherVal)
 

Static Private Member Functions

static auto produceResult ()
 

Member Function Documentation

◆ verifySaneInstanceHandling()

void verifySaneInstanceHandling ( )
inlineprivate
Test:
verify that ctor and dtor calls are balanced, even when assigning and self-assigning.

Definition at line 202 of file item-wrapper-test.cpp.

◆ verifySaneMoveHandling()

void verifySaneMoveHandling ( )
inlineprivate
Test:
proper handling of move and rvalue references

Definition at line 220 of file item-wrapper-test.cpp.

◆ verifyWrappedRef()

void verifyWrappedRef ( )
inlineprivate
Test:
verify especially that we can wrap and handle a reference "value" in a pointer-like manner

Definition at line 276 of file item-wrapper-test.cpp.

References lib::rani().

+ Here is the call graph for this function:

◆ verifyFunctionResult()

void verifyFunctionResult ( )
inlineprivate
Test:
verify an extension built on top of the ItemWrapper: a function which remembers the last result.

As a simple test, we bind a static helper function to produce a random value and remember the result returned last.

Definition at line 306 of file item-wrapper-test.cpp.

References VERIFY_ERROR.

◆ verifyFunctionRefResult()

void verifyFunctionRefResult ( )
inlineprivate
Test:
verify an extension built on top of the ItemWrapper: a function which remembers the last result.

Here we use a test function, which picks a member of an vector and returns a reference to it. Thus the cached "result" can be used to access and change the values within the original vector. In a real world usage scenario, such a function could be an (expensive) data structure access.

Definition at line 338 of file item-wrapper-test.cpp.

+ Inheritance diagram for ItemWrapper_test:
+ Collaboration diagram for ItemWrapper_test:

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