Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 98 of file item-wrapper-test.cpp.

Private Member Functions

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

Static Private Member Functions

static auto produceResult ()
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

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

References lib::rani(), ItemWrapper_test::verifyFunctionRefResult(), ItemWrapper_test::verifyFunctionResult(), ItemWrapper_test::verifySaneInstanceHandling(), ItemWrapper_test::verifySaneMoveHandling(), and ItemWrapper_test::verifyWrappedRef().

+ Here is the call graph for this function:

◆ verifyWrapper()

template<typename X >
void verifyWrapper ( val,
otherVal 
)
inlineprivate

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

References ItemWrapper< TY >::reset(), and VERIFY_ERROR.

+ Here is the call graph for this function:

◆ verifySaneInstanceHandling()

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

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

Referenced by ItemWrapper_test::run().

+ Here is the caller graph for this function:

◆ verifySaneMoveHandling()

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

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

Referenced by ItemWrapper_test::run().

+ Here is the caller graph for this function:

◆ verifyWrappedRef()

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

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

Referenced by ItemWrapper_test::run().

+ Here is the caller graph for this function:

◆ produceResult()

static auto produceResult ( )
inlinestaticprivate

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

References lib::rani().

Referenced by ItemWrapper_test::verifyFunctionResult().

+ Here is the call graph for this function:
+ Here is the caller 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 307 of file item-wrapper-test.cpp.

References ItemWrapper_test::produceResult(), and VERIFY_ERROR.

Referenced by ItemWrapper_test::run().

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

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

References VERIFY_ERROR.

Referenced by ItemWrapper_test::run().

+ Here is the caller graph for this function:
+ Inheritance diagram for ItemWrapper_test:
+ Collaboration diagram for ItemWrapper_test:

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