Lumiera  0.pre.03
»edityourfreedom«
GenericRecordRepresentation_test Class Reference

Description

Test:
Verify properties of a special collection type meant for external representation of object-like data, especially for symbolic representation in diff messages.
  • there is a type meta attribute
  • a Record can have attributes (by key) and contents (ordered list of values)
  • various kinds of iterators are provided
  • besides the regular constructor, which explicitly takes a type, a collection of attributes, and a collection of contents, there is a convenience constructor especially for literal notation and data definition. This one figures out the break between attributes and contents automatically; a type meta attribute is recognised and the first element without a given key or ID ends the attributes and starts the content scope
  • Record elements are conceived as values and equality is defined in terms of their contents, including the order (no normalisation, no sorting)
  • they are immutable after construction. But we provide a Mutator for remoulding a given element, enabling object builder notation.
  • a reference wrapper for handling of large structures is provided.
    Remarks
    this test uses the specialisation Record<string> solely, to cover the basic properties and behaviour, while leaving out the complexities of specific payload data types. For the actual use case, the symbolic description of data structure differences, we use a specific "value" within Record, the diff::GenNode, which is a limited typesafe Variant element, and in turn allows Record<GenNode> as embedded payload. Effectively this creates a "recursive data type", which is key to typesafe functional processing of unlimited data structures. The design of diff::Record only makes sense with this use case in mind; most notably, we have the keys (attribute names) embedded within the value payload, which turns attributes into just another content scope with special access operations. This also explains, why we do not normalise the content in any way; content is meant to reflect other data structures, which are normalised and maintained by their owner.
    See also
    GenNodeBasic_test
    tree-diff.cpp

Definition at line 127 of file generic-record-representation-test.cpp.

Private Member Functions

void copy_and_move ()
 
void equality ()
 
virtual void run (Arg)
 
void simpleUsage ()
 
void verifyCreation ()
 
void verifyMutations ()
 
void wrapRef ()
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

◆ simpleUsage()

void simpleUsage ( )
inlineprivate

Definition at line 143 of file generic-record-representation-test.cpp.

References util::contains(), util::join(), and VERIFY_ERROR.

Referenced by GenericRecordRepresentation_test::run().

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

◆ verifyCreation()

void verifyCreation ( )
inlineprivate

Definition at line 186 of file generic-record-representation-test.cpp.

References util::isnil().

Referenced by GenericRecordRepresentation_test::run().

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

◆ copy_and_move()

void copy_and_move ( )
inlineprivate

Definition at line 224 of file generic-record-representation-test.cpp.

References util::isnil(), and util::isSameObject().

Referenced by GenericRecordRepresentation_test::run().

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

◆ equality()

void equality ( )
inlineprivate

Definition at line 257 of file generic-record-representation-test.cpp.

Referenced by GenericRecordRepresentation_test::run().

+ Here is the caller graph for this function:

◆ verifyMutations()

void verifyMutations ( )
inlineprivate

Definition at line 310 of file generic-record-representation-test.cpp.

References util::isnil().

Referenced by GenericRecordRepresentation_test::run().

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

◆ wrapRef()

void wrapRef ( )
inlineprivate

Definition at line 345 of file generic-record-representation-test.cpp.

References RecordRef< VAL >::get(), util::isSameObject(), lib::diff::test::LAUNCHER(), and VERIFY_ERROR.

Referenced by GenericRecordRepresentation_test::run().

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

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