34 using LERR_(INVALID_SCOPE);
63 automaticFrameHandling();
64 verify_errorHandling();
74 CHECK (!isnil (stack));
75 CHECK (!isnil (stack.
top()));
76 CHECK (stack.
top().isRoot());
88 stack.
top().navigate(startPoint);
90 CHECK (
Scope(startPoint).getParent() == stack.
top().getLeaf());
91 CHECK (1 == stack.size());
96 CHECK (2 == stack.size());
97 CHECK (secondFrame == stack.
top());
98 CHECK (secondFrame.getLeaf() == startPoint);
99 CHECK (secondFrame.getLeaf() != firstFrame.getLeaf());
103 CHECK (2 == firstFrame.ref_count());
104 CHECK (1 == secondFrame.ref_count());
107 stack.
top().goRoot();
108 CHECK (!stack.
top());
109 CHECK (secondFrame.getLeaf().isRoot());
110 CHECK (secondFrame == stack.
top());
113 CHECK (1 == secondFrame.ref_count());
114 intrusive_ptr_release (&secondFrame);
115 CHECK (0 == secondFrame.ref_count());
117 CHECK (1 == stack.size());
118 CHECK (firstFrame == stack.
top());
121 CHECK (
Scope(startPoint).getParent() == stack.
top().getLeaf());
122 CHECK (2 == firstFrame.ref_count());
127 automaticFrameHandling ()
133 stack.
top().navigate(startPoint);
134 CHECK (1 == stack.size());
140 CHECK (3 == stack.size());
141 CHECK (1 == firstFrame.ref_count());
142 CHECK (0 == secondFrame.ref_count());
143 CHECK (0 == thirdFrame.ref_count());
148 CHECK (1 == stack.size());
149 CHECK (firstFrame == stack.
top());
150 CHECK (isSameObject(newTop, firstFrame));
151 CHECK (stack.
top().getLeaf() == startPoint);
155 CHECK (0 == anotherFrame.ref_count());
156 CHECK (1 == firstFrame.ref_count());
157 intrusive_ptr_release (&firstFrame);
158 CHECK (0 == firstFrame.ref_count());
159 CHECK (firstFrame.getLeaf() == startPoint);
162 CHECK (1 == stack.size());
167 CHECK (0 == anotherFrame2.ref_count());
168 CHECK (anotherFrame2.getLeaf().isRoot());
169 anotherFrame2.navigate(startPoint);
170 CHECK (anotherFrame2.getLeaf() == startPoint);
173 CHECK (1 == stack.size());
179 verify_errorHandling ()
185 stack.
top().navigate(startPoint);
186 CHECK (1 == stack.size());
189 ScopePath beforeInvalidNavigation = firstFrame;
194 CHECK (1 == stack.size());
195 CHECK (1 == firstFrame.ref_count());
196 CHECK (stack.
top().getLeaf() == startPoint);
200 CHECK (1 == stack.size());
201 CHECK (1 == firstFrame.ref_count());
202 CHECK (stack.
top().getLeaf() == startPoint);
211 stack.
top().moveUp();
224 CHECK (10 == stack.size());
226 CHECK (10 == stack.size());
227 CHECK (1 == stack.
top().ref_count());
230 CHECK (1 == stack.size());
233 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.
Simplistic 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, based directly on the referee's memory identities. ...