43 using LERR_(INVALID_SCOPE);
72 automaticFrameHandling();
73 verify_errorHandling();
83 CHECK (!isnil (stack));
84 CHECK (!isnil (stack.
top()));
85 CHECK (stack.
top().isRoot());
97 stack.
top().navigate(startPoint);
99 CHECK (
Scope(startPoint).getParent() == stack.
top().getLeaf());
100 CHECK (1 == stack.size());
105 CHECK (2 == stack.size());
106 CHECK (secondFrame == stack.
top());
107 CHECK (secondFrame.getLeaf() == startPoint);
108 CHECK (secondFrame.getLeaf() != firstFrame.getLeaf());
112 CHECK (2 == firstFrame.ref_count());
113 CHECK (1 == secondFrame.ref_count());
116 stack.
top().goRoot();
117 CHECK (!stack.
top());
118 CHECK (secondFrame.getLeaf().isRoot());
119 CHECK (secondFrame == stack.
top());
122 CHECK (1 == secondFrame.ref_count());
123 intrusive_ptr_release (&secondFrame);
124 CHECK (0 == secondFrame.ref_count());
126 CHECK (1 == stack.size());
127 CHECK (firstFrame == stack.
top());
130 CHECK (
Scope(startPoint).getParent() == stack.
top().getLeaf());
131 CHECK (2 == firstFrame.ref_count());
136 automaticFrameHandling ()
142 stack.
top().navigate(startPoint);
143 CHECK (1 == stack.size());
149 CHECK (3 == stack.size());
150 CHECK (1 == firstFrame.ref_count());
151 CHECK (0 == secondFrame.ref_count());
152 CHECK (0 == thirdFrame.ref_count());
157 CHECK (1 == stack.size());
158 CHECK (firstFrame == stack.
top());
159 CHECK (isSameObject(newTop, firstFrame));
160 CHECK (stack.
top().getLeaf() == startPoint);
164 CHECK (0 == anotherFrame.ref_count());
165 CHECK (1 == firstFrame.ref_count());
166 intrusive_ptr_release (&firstFrame);
167 CHECK (0 == firstFrame.ref_count());
168 CHECK (firstFrame.getLeaf() == startPoint);
171 CHECK (1 == stack.size());
176 CHECK (0 == anotherFrame2.ref_count());
177 CHECK (anotherFrame2.getLeaf().isRoot());
178 anotherFrame2.navigate(startPoint);
179 CHECK (anotherFrame2.getLeaf() == startPoint);
182 CHECK (1 == stack.size());
188 verify_errorHandling ()
194 stack.
top().navigate(startPoint);
195 CHECK (1 == stack.size());
198 ScopePath beforeInvalidNavigation = firstFrame;
203 CHECK (1 == stack.size());
204 CHECK (1 == firstFrame.ref_count());
205 CHECK (stack.
top().getLeaf() == startPoint);
209 CHECK (1 == stack.size());
210 CHECK (1 == firstFrame.ref_count());
211 CHECK (stack.
top().getLeaf() == startPoint);
220 stack.
top().moveUp();
233 CHECK (10 == stack.size());
235 CHECK (10 == stack.size());
236 CHECK (1 == stack.
top().ref_count());
239 CHECK (1 == stack.size());
242 CHECK (0 == stack.
top().ref_count());
Unit test helper to generate deliberately wrong placement scopes.
ScopePath & push(Scope const &)
Open a new path frame, pushing down the current frame.
bool empty() const
an empty path doesn't even contain a root element.
PPIdx build_testScopes()
helper for tests: create a pseudo-session (actually just a PlacementIndex), which contains some neste...
Scope const & fabricate_invalidScope()
void intrusive_ptr_add_ref(ScopePath *pathFrame)
management function for boost::intrusive_ptr to be picked up by ADL
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Sequence of nested scopes within the high-level model.
A Placement scope within the high-level-model.
PlacementMO & retrieve_startElm()
complement to the helper: retrieve one of the dummy placements which is a Placement<> and way down in...
Unit test helper to generate a system of nested test scopes.
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A collection of frequently used helper functions to support unit testing.
void pop_unused()
investigate the stack top and discard any path frames which aren't referred anymore (as indicated by ...
Implementation facility to work with and navigate nested scopes.
A custom stack holding ScopePath »frames«.
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.