41 using LERR_(INVALID_SCOPE);
42 using LERR_(NOT_IN_SESSION);
43 using LERR_(EMPTY_SCOPE_PATH);
67 CHECK (startPlacement.isValid());
77 clear (testPath, index);
84 Scope startScope (startPla);
105 Scope const& scopeOfEvil = fabricate_invalidScope();
106 CHECK (!scopeOfEvil.
isValid());
112 CHECK (!theInvalidToken.
isValid());
113 CHECK (theInvalidToken.
empty());
121 Scope refScope(refPlacement);
135 CHECK (path1.
contains (refPlacement));
137 Scope refScope (refPlacement);
139 CHECK (path1.
endsAt (refScope));
143 CHECK (path2.
endsAt (refScope));
145 CHECK (path1 == path2);
146 CHECK (!isSameObject (path1,path2));
149 CHECK (path2.
endsAt (parent));
150 CHECK (path1.
endsAt (refScope));
152 CHECK (path1 != path2);
153 CHECK (path2 != path1);
169 CHECK (!refPath.
empty());
171 CHECK (1 == refPath.
length());
174 CHECK (!defaultPath);
175 CHECK (refPath == defaultPath);
188 CHECK (isnil (invalidP));
192 CHECK (refPath.
contains (refPlacement));
193 CHECK (!invalidP.
contains (refPlacement));
195 Scope refScope (refPlacement);
196 CHECK (!invalidP.
contains (refScope));
199 CHECK (refPath.
contains (invalidP));
200 CHECK (!invalidP.
contains (refPath));
206 CHECK (1 == refPath.
length());
209 CHECK (refPath.
empty());
211 CHECK (refPath == invalidP);
213 CHECK (invalidP.
contains (refPath));
214 CHECK (!invalidP.
contains (refScope));
225 Scope startScope (refPlacement);
230 CHECK (path1.
contains (startScope));
231 CHECK (path2.
contains (startScope));
232 CHECK (path3.
contains (startScope));
234 CHECK (path1 == path2);
235 CHECK (path2 == path3);
236 CHECK (path1 == path3);
237 CHECK (!isSameObject (path1,path2));
238 CHECK (!isSameObject (path2,path3));
239 CHECK (!isSameObject (path1,path3));
244 CHECK (path1 == path2);
245 CHECK (path2 != path3);
246 CHECK (path1 != path3);
249 CHECK (path1 != path2);
250 CHECK (path2 == path3);
251 CHECK (path1 != path3);
254 CHECK (path1 != path2);
255 CHECK (path2 != path3);
256 CHECK (path1 != path3);
266 Scope startScope (refPlacement);
271 CHECK (!isSameObject (path1,path2));
285 CHECK (path1 != path3);
288 CHECK (path1 == path3);
309 #define __SHOWPATH(N) cout << "Step("<<N<<"): "<< path << endl;
312 CHECK (path == refPath);
316 CHECK (path != refPath);
318 CHECK (refPath.
endsAt (leaf));
319 CHECK (path.
endsAt (parent));
321 CHECK (parent == path.
getLeaf());
324 CHECK (path != refPath);
325 CHECK (path.
endsAt (root));
327 CHECK (!path.
endsAt (parent));
328 CHECK (!path.
endsAt (leaf));
331 CHECK (path.
endsAt (parent));
332 CHECK (!path.
endsAt (root));
333 CHECK (!path.
endsAt (leaf));
339 index->insert (newNode, parentRefPoint));
342 CHECK (sibling == newLocation);
344 CHECK (path.
endsAt (sibling));
354 CHECK (prefix.
endsAt (parent));
358 CHECK (path == prefix);
361 ScopePath beforeInvalidNavigation = path;
362 Scope const& unrelatedScope (fabricate_invalidScope());
364 CHECK (path == beforeInvalidNavigation);
373 CHECK (path.
contains(separatePlacement));
375 CHECK (isSameObject (other.
getTop(), separatePlacement));
377 CHECK (rootPrefix.
endsAt (root));
386 PMO& rootNode = index->getRoot();
387 CHECK (path.
getLeaf() != rootNode);
391 CHECK (!isnil (path));
392 CHECK (path.
getLeaf() == rootNode);
Accessing a STL element range through a Lumiera forward iterator, An instance of this iterator adapte...
Sequence of nested scopes within the high-level model.
bool endsAt(Scope const &) const
verify the scope in question is equivalent to our leaf scope.
Scope const & getLeaf() const
static const ScopePath INVALID
constant invalid path token.
bool isValid() const
a valid path consists of more than just the root element.
bool empty() const
an empty path doesn't even contain a root element.
bool contains(Scope const &) const
void navigate(Scope const &)
A Placement scope within the high-level-model.
PlacementMO & getTop() const
Scope getParent() const
retrieve the parent scope which encloses this scope.
bool isValid() const
check if this scope can be located.
static const Scope INVALID
constant invalid scope token.
void check_RefcountProtection(PMO &refPlacement)
void checkRelations(ScopePath path1, PMO &refPlacement)
void clear(ScopePath &path, PPIdx index)
ScopePath buildPath(PMO &startPla)
void navigate(const ScopePath refPath, PPIdx index)
void check_Identity_and_Copy(PMO &refPlacement)
void invalidPath(ScopePath refPath, PMO &refPlacement)
void checkIteration(ScopePath path, PMO &refPlacement)
void rootPath(ScopePath refPath)
void checkInvalidScopeDetection()
Test MObject subclass, which, contrary to any real MObject, can be created directly without involving...
PlacementMO & retrieve_firstTestSubMO21()
PPIdx build_testScopes()
helper for tests: create a pseudo-session (actually just a PlacementIndex), which contains some neste...
std::shared_ptr< PlacementIndex > PPIdx
PlacementMO & retrieve_startElm()
complement to the helper: retrieve one of the dummy placements which is a Placement<> and way down in...
ScopeQuery< MObject >::iterator explore_testScope(PlacementMO const &scopeTop)
shortcut to explore the contents of a scope within the current index.
Namespace of Session and user visible high-level objects.
bool disjoint(ScopePath const &path1, ScopePath const &path2)
void intrusive_ptr_add_ref(ScopePath *pathFrame)
management function for boost::intrusive_ptr to be picked up by ADL
void intrusive_ptr_release(ScopePath *pathFrame)
ScopePath commonPrefix(ScopePath const &path1, ScopePath const &path2)
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.
bool isnil(lib::time::Duration const &dur)
Core of the session implementation datastructure.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
An Object representing a sequence of nested scopes within the Session.
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.
Unit test helper to generate deliberately wrong placement scopes.
Unit test helper to generate a system of nested test scopes.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...