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

Description

Test:
proof-of-concept test for a combined symbolic and hash based ID.
  • create some symbolic IDs
  • check default assignment works properly
  • check comparisons
  • check hashing
  • use the embedded hash ID (LUID) as hashtable key
See also
lib::HashIndexed::Id
mobject::Placement real world usage example

Definition at line 83 of file entry-id-test.cpp.

Private Types

typedef std::unordered_map< DummyID, string, DummyID::UseEmbeddedHashHashtable
 

Private Member Functions

void buildHashtable ()
 
void checkBasicProperties ()
 
void checkComparisions ()
 
void checkCreation ()
 
void checkErasure ()
 
virtual void run (Arg)
 

Static Private Member Functions

static bool checkForHashCollision (string const &key, string const &val)
 
static bool verifyEntry (Hashtable::value_type entry)
 

Member Function Documentation

◆ checkErasure()

void checkErasure ( )
inlineprivate
Test:
handling of EntryIDs through their common base class, which means erasing the specific type information.

While this type information can't be recovered after erasure, we can try to upcast back to a known type; this upcast is safe, because the embedded hash-ID is based on the type info.

Definition at line 220 of file entry-id-test.cpp.

References BareEntryID::recast(), and VERIFY_ERROR.

+ Here is the call graph for this function:

◆ buildHashtable()

void buildHashtable ( )
inlineprivate
Test:
build a hashtable, using EntryID as key, thereby using the embedded hash-ID
Note
there is a known weakness of the boost::hash when used on IDs with a running number suffix. /////TICKET #587 We use a trick to spread the numbers better.
See also
HashGenerator_test::verify_Knuth_workaround

Definition at line 282 of file entry-id-test.cpp.

+ Inheritance diagram for EntryID_test:
+ Collaboration diagram for EntryID_test:

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