add a start-element shortcut to the test-helper
This allows to get a start Placement, which is known to be way down in the test-hierarchy of Placements created by build_testScopes()
This commit is contained in:
parent
1a02239e26
commit
218e1b8d60
4 changed files with 25 additions and 27 deletions
|
|
@ -65,8 +65,7 @@ namespace test {
|
||||||
{
|
{
|
||||||
// Prepare an (test)Index backing the PlacementRefs
|
// Prepare an (test)Index backing the PlacementRefs
|
||||||
PPIdx index = build_testScopes();
|
PPIdx index = build_testScopes();
|
||||||
#if false ////////////////////////////////////////////////////////////////////////////////TICKET 384
|
PMO& startPlacement = retrieve_startElm();
|
||||||
PMO& startPlacement = *(index->query<TestSubMO1>(index->getRoot()));
|
|
||||||
ASSERT (startPlacement);
|
ASSERT (startPlacement);
|
||||||
|
|
||||||
ScopePath testPath = buildPath (startPlacement);
|
ScopePath testPath = buildPath (startPlacement);
|
||||||
|
|
@ -76,7 +75,6 @@ namespace test {
|
||||||
check_Identity_and_Copy (startPlacement);
|
check_Identity_and_Copy (startPlacement);
|
||||||
navigate (testPath, index);
|
navigate (testPath, index);
|
||||||
clear (testPath, index);
|
clear (testPath, index);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace test {
|
||||||
run (Arg)
|
run (Arg)
|
||||||
{
|
{
|
||||||
// Prepare an (test)Index (dummy "session")
|
// Prepare an (test)Index (dummy "session")
|
||||||
build_testScopes();
|
PPIdx testSession (build_testScopes());
|
||||||
|
|
||||||
QueryResolver const& resolver = SessionServiceExploreScope::getResolver();
|
QueryResolver const& resolver = SessionServiceExploreScope::getResolver();
|
||||||
PlacementMO const& scope = SessionServiceExploreScope::getScopeRoot();
|
PlacementMO const& scope = SessionServiceExploreScope::getScopeRoot();
|
||||||
|
|
|
||||||
|
|
@ -23,16 +23,8 @@
|
||||||
|
|
||||||
#include "proc/mobject/session/test-scopes.hpp"
|
#include "proc/mobject/session/test-scopes.hpp"
|
||||||
#include "proc/mobject/session/session-service-mock-index.hpp"
|
#include "proc/mobject/session/session-service-mock-index.hpp"
|
||||||
//#include "lib/util.hpp"
|
#include "proc/mobject/session/session-service-explore-scope.hpp"
|
||||||
|
#include "proc/mobject/session/scope-query.hpp"
|
||||||
//#include <iostream>
|
|
||||||
//#include <string>
|
|
||||||
|
|
||||||
//using util::isSameObject;
|
|
||||||
//using lumiera::Time;
|
|
||||||
//using std::string;
|
|
||||||
//using std::cout;
|
|
||||||
//using std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
namespace mobject {
|
namespace mobject {
|
||||||
|
|
@ -90,4 +82,18 @@ namespace test {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** @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.
|
||||||
|
* @throw lumiera::error::Invalid if the intended start element doesn't exist (anymore)
|
||||||
|
*/
|
||||||
|
PlacementMO&
|
||||||
|
retrieve_startElm()
|
||||||
|
{
|
||||||
|
return *ContentsQuery<TestSubMO1>(SessionServiceExploreScope::getResolver()
|
||||||
|
,SessionServiceExploreScope::getScopeRoot());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}}} // namespace mobject::session::test
|
}}} // namespace mobject::session::test
|
||||||
|
|
|
||||||
|
|
@ -25,22 +25,10 @@
|
||||||
#define MOBJECT_SESSION_TEST_TEST_SCOPES_H
|
#define MOBJECT_SESSION_TEST_TEST_SCOPES_H
|
||||||
|
|
||||||
|
|
||||||
//#include "lib/lumitime.hpp"
|
|
||||||
//#include "proc/mobject/placement-ref.hpp"
|
|
||||||
#include "proc/mobject/session/test-scopes.hpp"
|
|
||||||
#include "proc/mobject/test-dummy-mobject.hpp"
|
#include "proc/mobject/test-dummy-mobject.hpp"
|
||||||
#include "proc/mobject/session/placement-index.hpp"
|
#include "proc/mobject/session/placement-index.hpp"
|
||||||
//#include "lib/util.hpp"
|
|
||||||
|
|
||||||
#include <tr1/memory>
|
#include <tr1/memory>
|
||||||
//#include <iostream>
|
|
||||||
//#include <string>
|
|
||||||
|
|
||||||
//using util::isSameObject;
|
|
||||||
//using lumiera::Time;
|
|
||||||
//using std::string;
|
|
||||||
//using std::cout;
|
|
||||||
//using std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
namespace mobject {
|
namespace mobject {
|
||||||
|
|
@ -67,5 +55,11 @@ namespace test {
|
||||||
PPIdx build_testScopes();
|
PPIdx build_testScopes();
|
||||||
|
|
||||||
|
|
||||||
|
/** complement to the helper: retrieve one of the dummy placements
|
||||||
|
* which is a Placement<> and way down into the hierarchy
|
||||||
|
*/
|
||||||
|
PlacementMO& retrieve_startElm();
|
||||||
|
|
||||||
|
|
||||||
}}} // namespace mobject::session::test
|
}}} // namespace mobject::session::test
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue