43 using session::test::TestClip;
44 using LERR_(BOTTOM_PLACEMENTREF);
45 using LERR_(NONEMPTY_SCOPE);
46 using LERR_(INVALID_SCOPE);
94 CHECK (siz == index.
size());
104 CHECK (0 == index.
size());
106 PMO::ID elmID = index.
insert (clip, root);
107 CHECK (1 == index.
size());
112 CHECK (1 == index.
size());
114 CHECK (0 == index.
size());
125 PMO::ID elmID = index.
insert (testObj, root);
128 CHECK (elmID == elm.
getID());
129 CHECK (!isSameObject (elm,testObj));
131 CHECK (elmID != testObj.
getID());
133 PMO::ID elmID2 = index.
insert(testObj, root);
134 CHECK (elmID2 != elmID);
135 CHECK (testObj != index.
find (elmID));
136 CHECK (testObj != index.
find (elmID2));
139 CHECK (!isSameObject (testObj, index.
find(elmID2)));
140 CHECK (!isSameObject (elm, index.
find(elmID2)));
143 CHECK ( isSameObject (elm, index.
find(elmID )));
144 CHECK ( isSameObject (elm, index.
find(elmID )));
147 CHECK ( isSameObject (elm, index.
find(elm)));
157 CHECK (elmID == elm.
getID());
162 typedef PlacementMO::Id<Clip> IDClip;
163 IDClip clipID = index.
insert(anotherTestClip, elmID);
167 PMO::ID mID = clipID;
174 CHECK ( isSameObject(asMO,asClip));
175 CHECK (!isSameObject(asClip, anotherTestClip));
183 PlacementMO::ID invalidID (invalid);
184 CHECK (!
bool(invalidID));
185 CHECK (!
bool(invalid));
196 CHECK (
false == index.
remove(invalidID));
207 ID e1 = index.
insert (testObj, root);
208 ID e11 = index.
insert (testObj, e1);
209 ID e12 = index.
insert (testObj, e1);
210 ID e13 = index.
insert (testObj, e1);
211 ID e131 = index.
insert (testObj, e13);
212 ID e132 = index.
insert (testObj, e13);
213 ID e133 = index.
insert (testObj, e13);
214 ID e1331 = index.
insert (testObj, e133);
235 CHECK (index.
remove(e1331));
237 CHECK (!index.
remove(e1331));
239 CHECK (index.
remove(e133));
245 ID e1321 = index.
insert (testObj, e132);
246 ID e13211 = index.
insert (testObj, e1321);
247 ID e13212 = index.
insert (testObj, e1321);
248 ID e13213 = index.
insert (testObj, e1321);
249 ID e13214 = index.
insert (testObj, e1321);
250 ID e132131 = index.
insert (testObj, e13213);
251 ID e132132 = index.
insert (testObj, e13213);
252 ID e132133 = index.
insert (testObj, e13213);
253 ID e132134 = index.
insert (testObj, e13213);
254 ID e132141 = index.
insert (testObj, e13214);
255 ID e132142 = index.
insert (testObj, e13214);
256 ID e132143 = index.
insert (testObj, e13214);
257 ID e132144 = index.
insert (testObj, e13214);
273 CHECK (siz == index.
size());
298 CHECK (rootContents);
310 cout <<
indent(level) <<
"::" << *
iter << endl;
315 discover (index, scopeContents, level+1);
318 static _Fmt summary{
"...%i elements at Level %i"};
319 cout <<
indent(level) << summary % count % level << endl;
328 return string (level,
' ');
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Structured compound of Placement instances with lookup capabilities.
bool remove(PlacementMO &)
bool isValid() const
validity self-check, used for sanity checks and the session self-check.
PlacementMO & getRoot() const
retrieve the logical root scope
bool contains(PlacementMO const &) const
PlacementMO & getScope(PlacementMO const &) const
PlacementMO & find(ID) const
iterator getReferrers(ID) const
Retrieve all the elements attached to the given entry (scope) Each element (Placement) can act as a s...
ID insert(PlacementMO const &newObj, ID targetScope)
Add a new Placement (Object "instance") into the index.
void clear(ID targetScope)
recursively kill a complete scope, including the given element and all children.
void checkTypedAccess(Idx index, PMO::ID elmID)
void checkSimpleInsertRemove(Idx index)
void checkInvalidRef(Idx index)
void discover(Idx index, Iter iter, uint level)
PMO::ID checkSimpleAccess(Idx index)
void checkScopeHandling(Idx index)
PlacementIndex::iterator Iter
static string indent(uint level)
void checkContentsEnumeration(Idx index)
void has_size(uint siz, Idx index)
static Placement< Clip > create()
A front-end for using printf-style formatting.
Placement< Label > make_dummyRoot()
const Duration LENGTH_TestClip(Time(0, 25, 0, 0))
Namespace of Session and user visible high-level objects.
bool isSameDef(PlacementMO const &pl1, PlacementMO const &pl2)
compare the properties of placement
Steam-Layer implementation namespace 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.
Core of the session implementation datastructure.
Core abstraction: placement of a media object into session context.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
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.
A stub implementation of the Clip interface for unit testing.
Setup of a faked session root for unit testing.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...