diff --git a/src/proc/mobject/placement-index.cpp b/src/proc/mobject/placement-index.cpp index 38758d80e..ac6bbb279 100644 --- a/src/proc/mobject/placement-index.cpp +++ b/src/proc/mobject/placement-index.cpp @@ -59,7 +59,6 @@ namespace mobject { /* some type shorthands */ - typedef shared_ptr PIdx; typedef PlacementIndex::PlacementMO PlacementMO; typedef PlacementIndex::PRef PRef; typedef PlacementIndex::ID ID; @@ -146,9 +145,9 @@ namespace mobject { namespace { // implementation detail: default global placement index access - PIdx globalIndex; + PPIdx globalIndex; - PIdx const& + PPIdx const& getGlobalIndex() { if (globalIndex) @@ -164,7 +163,7 @@ namespace mobject { void - reset_PlacementIndex (PIdx const& alternativeIndex) + reset_PlacementIndex (PPIdx const& alternativeIndex) { globalIndex = alternativeIndex; } diff --git a/src/proc/mobject/placement-index.hpp b/src/proc/mobject/placement-index.hpp index 5d9da5ff7..362ad7c8b 100644 --- a/src/proc/mobject/placement-index.hpp +++ b/src/proc/mobject/placement-index.hpp @@ -116,13 +116,16 @@ namespace mobject { }; ////////////////TODO currently just fleshing out the API; probably have to split off an impl.class; but for now a PImpl is sufficient... + + typedef shared_ptr PPIdx; + /** @internal there is an implicit PlacementIndex available on a global scale, * by default implemented within the current session. This function allows * to re-define this implicit index temporarily, e.g. for unit tests. */ void - reset_PlacementIndex(shared_ptr const&) ; + reset_PlacementIndex(PPIdx const&) ; /** @internal restore the implicit PlacementIndex to its default implementation (=the session) */ void diff --git a/tests/components/proc/mobject/placement-scope-test.cpp b/tests/components/proc/mobject/placement-scope-test.cpp index cac6cc14b..86c51b184 100644 --- a/tests/components/proc/mobject/placement-scope-test.cpp +++ b/tests/components/proc/mobject/placement-scope-test.cpp @@ -69,7 +69,7 @@ namespace test { run (Arg) { // Prepare an (test)Index backing the PlacementRefs - PIdx index = build_testScopes(); + PPIdx index = build_testScopes(); UNIMPLEMENTED ("function test of placement scope interface"); verifyLookup (index); diff --git a/tests/components/proc/mobject/query-focus-test.cpp b/tests/components/proc/mobject/query-focus-test.cpp index 4500c0db6..f3253af4b 100644 --- a/tests/components/proc/mobject/query-focus-test.cpp +++ b/tests/components/proc/mobject/query-focus-test.cpp @@ -61,7 +61,7 @@ namespace test { { // Prepare an (test)Index backing the PlacementRefs - PIdx index = build_testScopes(); + PPIdx index = build_testScopes(); // PMO& root = index->getRoot(); UNIMPLEMENTED ("unit test to cover query focus management"); diff --git a/tests/components/proc/mobject/scope-path-test.cpp b/tests/components/proc/mobject/scope-path-test.cpp index 817883c4b..cc05c1d3f 100644 --- a/tests/components/proc/mobject/scope-path-test.cpp +++ b/tests/components/proc/mobject/scope-path-test.cpp @@ -62,7 +62,7 @@ namespace test { run (Arg) { // Prepare an (test)Index backing the PlacementRefs - PIdx index = build_testScopes(); + PPIdx index = build_testScopes(); UNIMPLEMENTED ("unit test regarding placement scope handling"); } diff --git a/tests/components/proc/mobject/session/test-scopes.cpp b/tests/components/proc/mobject/session/test-scopes.cpp index 0b58081d5..b1cab5cf2 100644 --- a/tests/components/proc/mobject/session/test-scopes.cpp +++ b/tests/components/proc/mobject/session/test-scopes.cpp @@ -57,17 +57,21 @@ namespace test { * test PlacementIndex will be cleared automatically, and the * default Index within the session will be re-activated. */ - PIdx + PPIdx build_testScopes() { - PSub p1(*new TestSubMO21); - PSub p2(*new TestSubMO21); - PSub p3(*new TestSubMO21); - PSub p4(*new TestSubMO21); - PSub p5(*new TestSubMO21); + PDum p1(*new TestSubMO21); + PDum p2(*new TestSubMO21); + PDum p3(*new TestSubMO21); + PDum p4(*new TestSubMO21); + PDum p5(*new TestSubMO21); + + PDum ps1(*new DummyMO); + PDum ps2(*new TestSubMO1); + PDum ps2(*new TestSubMO2); // Prepare an (test)Index backing the PlacementRefs - PIdx index (PlacementIndex::create().get(), &remove_testIndex); // taking ownership + PPIdx index (PlacementIndex::create().get(), &remove_testIndex); // taking ownership reset_PlacementIndex(index); PMO& root = index->getRoot(); @@ -77,6 +81,10 @@ namespace test { index->insert (p4, p3 ); index->insert (p5, p4 ); + index->insert (ps1,root); + index->insert (ps2,root); + index->insert (ps3,root); + return index; } diff --git a/tests/components/proc/mobject/session/test-scopes.hpp b/tests/components/proc/mobject/session/test-scopes.hpp index 760ab0d75..bb9690902 100644 --- a/tests/components/proc/mobject/session/test-scopes.hpp +++ b/tests/components/proc/mobject/session/test-scopes.hpp @@ -50,8 +50,7 @@ namespace test { using std::tr1::shared_ptr; using namespace mobject::test; - typedef TestPlacement PSub; - typedef shared_ptr PIdx; + typedef TestPlacement PDum; @@ -65,7 +64,7 @@ namespace test { * @see session::SessManagerImpl::getCurrentIndex() * @see mobject::reset_PlacementIndex */ - PIdx build_testScopes(); + PPIdx build_testScopes(); }}} // namespace mobject::session::test