Lumiera  0.pre.03
»edit your freedom«
test-scopes.hpp File Reference

Go to the source code of this file.

Description

Unit test helper to generate a system of nested test scopes.

These can be used to verify session search and discovery functionality. The build_testScopes() function generates a system of placements and MObjects with a known, fixed layout.

Definition in file test-scopes.hpp.

Typedefs

typedef ScopeQuery< MObject >::iterator _ScopeIterMO
 
typedef std::shared_ptr< PlacementIndex > PPIdx
 

Functions

PPIdx build_testScopes ()
 helper for tests: create a pseudo-session (actually just a PlacementIndex), which contains some nested placement scopes. More...
 
ScopeQuery< MObject >::iterator explore_testScope (PlacementMO const &scopeTop)
 shortcut to explore the contents of a scope within the current index. More...
 
PlacementMO & retrieve_firstTestSubMO21 ()
 
PlacementMO & retrieve_startElm ()
 complement to the helper: retrieve one of the dummy placements which is a Placement<> and way down into the hierarchy More...
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::mobject
 Media-Objects, edit operations and high-level session.
 
 steam::mobject::session
 Namespace of Session and user visible high-level objects.
 

Function Documentation

◆ build_testScopes()

PPIdx build_testScopes ( )

helper for tests: create a pseudo-session (actually just a PlacementIndex), which contains some nested placement scopes.

Note
this dummy index isn't actively connected to the session; the unit tests rely on this dummy index containing a specific tree structure of test-dummy MObjects.
Returns
new PlacementIndex, which has already been activated to be used by all Placements from now on. This activation will be cleared automatically, when this object goes out of scope.
See also
mobject::PlacementIndex
session::SessManagerImpl::getCurrentIndex()
mobject::session::SessionServiceMockIndex::reset_PlacementIndex

Definition at line 47 of file test-scopes.cpp.

References steam::mobject::session::test::build_testScopes(), and SessionServiceMockIndex::install().

Referenced by steam::mobject::session::test::build_testScopes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ retrieve_startElm()

PlacementMO & retrieve_startElm ( )

complement to the helper: retrieve one of the dummy placements which is a Placement<> and way down into the hierarchy

Note
this test helper only works if build_testScopes is invoked beforehand, and the returned smart-ptr to the created test/dummy index is retained. Moreover, this function makes assumptions about the actual objects created by the former test function.
Exceptions
lumiera::error::Invalidif the intended start element doesn't exist (anymore)

Definition at line 96 of file test-scopes.cpp.

References steam::mobject::session::test::retrieve_startElm().

Referenced by steam::mobject::session::test::retrieve_startElm(), and PlacementScope_test::verifyEquality().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ explore_testScope()

_ScopeIterMO explore_testScope ( PlacementMO const &  scopeTop)

shortcut to explore the contents of a scope within the current index.

Usually, clients would use QueryFocus or ScopeLocator to perform this task, but for the purpose of testing we're better off to invoke the query directly

Definition at line 109 of file test-scopes.cpp.

References steam::mobject::session::CHILDREN, steam::mobject::session::test::explore_testScope(), and SessionServiceExploreScope::getResolver().

Referenced by steam::mobject::session::test::explore_testScope().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: