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());
112 CHECK (woof == StateMapGroupingStorage::getID(*elm));
113 CHECK (2 == StateMapGroupingStorage::getState(*elm).size());
114 CHECK (
Ref::NO == StateMapGroupingStorage::getState(*elm,
"doodle"));
115 CHECK (toyPoodle == StateMapGroupingStorage::getState(*elm,
"poodle"));
116 CHECK (mastiff == StateMapGroupingStorage::getState(*elm,
"mastiff"));
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());
138 CHECK (miaow == StateMapGroupingStorage::getID(*elm));
139 CHECK (0 == StateMapGroupingStorage::getState(*elm).size());
143 CHECK (isnil (storage));
144 CHECK (0 == storage.size());
void record(BareEntryID const &elementID, GenNode const &stateMark)
remember the state mark for the denoted element
Implementation of storage for captured presentation state.
void clearProperty(BareEntryID const &elementID, string propertyKey)
clear previously recorded state for a given element and specific property
typed symbolic and hash ID for asset-like position accounting.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Map storage for captured presentation state information.
Simplistic test class runner.
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Generic building block for tree shaped (meta)data structures.
A collection of frequently used helper functions to support unit testing.
static const Ref NO
symbolic ID ref "_NO_"
GenNode const & retrieve(BareEntryID const &elementID, string propertyKey) const
retrieve captured state
Bare symbolic and hash ID used for accounting of asset like entries.
generic data element node within a tree
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...