Lumiera  0.pre.03
»edityourfreedom«
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 Typedef Documentation

◆ Hashtable

typedef std::unordered_map<DummyID, string, DummyID::UseEmbeddedHash> Hashtable
private

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

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

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

◆ checkCreation()

void checkCreation ( )
inlineprivate

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

References util::isSameObject(), and BareEntryID::isValid().

+ Here is the call graph for this function:

◆ checkBasicProperties()

void checkBasicProperties ( )
inlineprivate

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

References proc::asset::idi::getAssetIdent(), BareEntryID::getHash(), BareEntryID::getSym(), Asset::Ident::name, lib::test::randStr(), and proc::asset::STRUCT.

+ Here is the call graph for this function:

◆ checkComparisions()

void checkComparisions ( )
inlineprivate

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

◆ 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::getHash(), BareEntryID::getSym(), util::isSameObject(), BareEntryID::recast(), EntryID< TY >::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.

References util::and_all().

+ Here is the call graph for this function:

◆ verifyEntry()

static bool verifyEntry ( Hashtable::value_type  entry)
inlinestaticprivate

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

◆ checkForHashCollision()

static bool checkForHashCollision ( string const &  key,
string const &  val 
)
inlinestaticprivate

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

References lib::idi::test::LAUNCHER().

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

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