40 using lumiera::error::LUMIERA_ERROR_WRONG_TYPE;
61 GenNode poodle{
"poodle",
"Pudel"};
62 GenNode toyPoodle{
"poodle",
"Zwergpudel"};
63 GenNode labradoodle {
"poodle",
false };
64 GenNode mastiff{
"mastiff",
"Dogge"};
70 CHECK (isnil (storage));
71 CHECK (0 == storage.
size());
73 storage.
record (woof, poodle);
74 CHECK (not isnil(storage));
75 CHECK (1 == storage.
size());
77 CHECK (poodle == storage.
retrieve(woof,
"poodle"));
78 CHECK (not isSameObject (poodle, storage.
retrieve(woof,
"poodle")));
83 storage.
record (woof, mastiff);
84 CHECK (2 == storage.
size());
85 CHECK (poodle == storage.
retrieve(woof,
"poodle"));
86 CHECK (mastiff == storage.
retrieve(woof,
"mastiff"));
89 storage.
record (woof, toyPoodle);
90 CHECK (2 == storage.
size());
91 CHECK (poodle != storage.
retrieve(woof,
"poodle"));
92 CHECK (toyPoodle == storage.
retrieve(woof,
"poodle"));
99 CHECK (2 == storage.
size());
100 CHECK (toyPoodle == storage.
retrieve(woof,
"poodle"));
101 CHECK (mastiff == storage.
retrieve(woof,
"mastiff"));
104 storage.
record (quack, duck);
105 CHECK (3 == storage.
size());
106 CHECK (toyPoodle == storage.
retrieve(woof,
"poodle"));
107 CHECK (mastiff == storage.
retrieve(woof,
"mastiff"));
108 CHECK (duck == storage.
retrieve(quack,
"duck"));
110 auto elm = storage.
find(woof);
111 CHECK (elm != storage.
end());
118 elm = storage.
find(miaow);
119 CHECK (elm == storage.
end());
122 storage.
record (miaow, labradoodle);
123 CHECK (labradoodle == storage.
retrieve(miaow,
"poodle"));
124 CHECK (4 == storage.
size());
127 CHECK (4 == storage.
size());
128 CHECK (labradoodle == storage.
retrieve(miaow,
"poodle"));
132 CHECK (3 == storage.
size());
136 elm = storage.
find(miaow);
137 CHECK (elm != storage.
end());
143 CHECK (isnil (storage));
144 CHECK (0 == storage.
size());
Map storage for captured presentation state information.
static StateData const & getState(Record const &entry)
void clearProperty(BareEntryID const &elementID, string propertyKey)
clear previously recorded state for a given element and specific property
static BareEntryID const & getID(Record const &entry)
void record(BareEntryID const &elementID, GenNode const &stateMark)
remember the state mark for the denoted element
GenNode const & retrieve(BareEntryID const &elementID, string propertyKey) const
retrieve captured state
iterator find(BareEntryID const &elementID) const
Bare symbolic and hash ID used for accounting of asset like entries.
Generic building block for tree shaped (meta)data structures.
Lumiera GTK UI implementation root.
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Implementation of storage for captured presentation state.
generic data element node within a tree
static const Ref NO
symbolic ID ref "_NO_"
typed symbolic and hash ID for asset-like position accounting.
A collection of frequently used helper functions to support unit testing.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...