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 108 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)
 

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 211 of file item-wrapper-test.cpp.

◆ verifySaneMoveHandling()

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

Definition at line 229 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 285 of file item-wrapper-test.cpp.

◆ 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 the rand() standard lib function and remember the last returned random value.

Definition at line 313 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 345 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: