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

Description

Test:
verify identity based on memory address location, which can be relevant for custom allocation schemes and to prevent self-assignment.
  • access to a given entitie's address is used as foundation, with the special twist that a pointer is »unpacked«
  • based on this address, an ID-number can be generated
  • moreover, two flavours of identity check are provided
    • util::isSameObject compares at the level of the language object — it takes its arguments solely by reference and does not »unpack« a pointer. The term object is used here as in the C++ standard
    • util::isSameAdr accepts any mix of references and pointers, disregarding any type information, thereby »unpacking« the address information contained in a pointer is (i.e. the address of the pointee is used)

Definition at line 53 of file util-identity-test.cpp.

Classes

struct  Boo
 dummy entity to compare More...
 
struct  SuBoo
 

Private Member Functions

void run (Arg)
 
void verify_addrID ()
 
void verify_getAdr ()
 
void verify_isSameAdr ()
 
void verify_isSameObject ()
 

Static Private Member Functions

static BooasBoo (void *mem)
 

Member Function Documentation

◆ verify_getAdr()

void verify_getAdr ( )
inlineprivate
Test:
determine the address of an referred entity, possibly unpacking a pointer (using its content)

Definition at line 70 of file util-identity-test.cpp.

References util::getAdr().

+ Here is the call graph for this function:

◆ verify_addrID()

void verify_addrID ( )
inlineprivate
Test:
generate a numeric ID based on the memory address.

Definition at line 85 of file util-identity-test.cpp.

References util::addrID().

+ Here is the call graph for this function:

◆ verify_isSameAdr()

void verify_isSameAdr ( )
inlineprivate
Test:
determine identity of referred arguments based on their memory location; pointers are unpacked, referring to the pointee.

Definition at line 120 of file util-identity-test.cpp.

References util::isSameAdr().

+ Here is the call graph for this function:

◆ verify_isSameObject()

void verify_isSameObject ( )
inlineprivate
Test:
determine strictly the identity of referred entities as given.

Definition at line 170 of file util-identity-test.cpp.

References util::isSameObject().

+ Here is the call graph for this function:
+ Inheritance diagram for UtilIdentity_test:
+ Collaboration diagram for UtilIdentity_test:

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