Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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 74 of file entry-id-test.cpp.

Private Types

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

Private Member Functions

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

Static Private Member Functions

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

Member Typedef Documentation

◆ Hashtable

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

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

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

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

References EntryID_test::buildHashtable(), EntryID_test::checkBasicProperties(), EntryID_test::checkComparisions(), EntryID_test::checkCreation(), and EntryID_test::checkErasure().

+ Here is the call graph for this function:

◆ checkCreation()

void checkCreation ( )
inlineprivate

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

Referenced by EntryID_test::run().

+ Here is the caller graph for this function:

◆ checkBasicProperties()

void checkBasicProperties ( )
inlineprivate

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

References steam::asset::idi::getAssetIdent(), and steam::asset::STRUCT.

Referenced by EntryID_test::run().

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

◆ checkComparisions()

void checkComparisions ( )
inlineprivate

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

Referenced by EntryID_test::run().

+ Here is the caller graph for this function:

◆ 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 211 of file entry-id-test.cpp.

References BareEntryID::getHash(), BareEntryID::getSym(), BareEntryID::recast(), and VERIFY_ERROR.

Referenced by EntryID_test::run().

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

References EntryID_test::verifyEntry().

Referenced by EntryID_test::run().

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

◆ verifyEntry()

static bool verifyEntry ( Hashtable::value_type  entry)
inlinestaticprivate

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

References EntryID_test::checkForHashCollision().

Referenced by EntryID_test::buildHashtable().

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

◆ checkForHashCollision()

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

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

Referenced by EntryID_test::verifyEntry().

+ Here is the caller 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: