Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
Symbol_test Class Reference

Description

Test:
properties of Literal and Symbol data types.
  • a lib::Literal is just a thin wrapper for a const char *
  • lib::Symbol uses the same implementation, but relies on character string constants interned into a symbol table.
Todo:
2023 this test is very much in preliminary shape, as the implementation of a real symbol table remains was lacking. At some point, a simplistic implementation of »interned strings« was added (TICKET #157) — yet still the actual relevance of unique Symbols remains nebulous

Definition at line 52 of file symbol-test.cpp.

Private Member Functions

virtual void run (Arg)
 
void checkLiteral ()
 
void checkEmptyLiteral ()
 
void checkSymbolCreation ()
 
void checkComparisons ()
 
void use_as_map_key ()
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

Definition at line 56 of file symbol-test.cpp.

References Symbol_test::checkComparisons(), Symbol_test::checkLiteral(), Symbol_test::checkSymbolCreation(), and Symbol_test::use_as_map_key().

+ Here is the call graph for this function:

◆ checkLiteral()

void checkLiteral ( )
inlineprivate

Definition at line 66 of file symbol-test.cpp.

References lib::hash_value(), and lib::test::showSizeof().

Referenced by Symbol_test::run().

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

◆ checkEmptyLiteral()

void checkEmptyLiteral ( )
inlineprivate

Definition at line 94 of file symbol-test.cpp.

◆ checkSymbolCreation()

void checkSymbolCreation ( )
inlineprivate

Definition at line 108 of file symbol-test.cpp.

References Symbol::BOTTOM, Literal::c(), Symbol::EMPTY, Symbol::FAILURE, and lib::hash_value().

Referenced by Symbol_test::run().

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

◆ checkComparisons()

void checkComparisons ( )
inlineprivate

Definition at line 157 of file symbol-test.cpp.

References Literal::c().

Referenced by Symbol_test::run().

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

◆ use_as_map_key()

void use_as_map_key ( )
inlineprivate
Test:
use Literal and Symbol as keys in a tree map.
Note
neither Literal, nor Symbol defines an operator< so the map specialisation has to fall back on const char*, which are compared based on pointer identity. Contrast this with std::string, which does define its own ordering.

Definition at line 217 of file symbol-test.cpp.

Referenced by Symbol_test::run().

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

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