WIP test-driven brainstorming: what is a Scope?

This commit is contained in:
Fischlurch 2009-10-17 02:15:28 +02:00
parent cfc17e75ba
commit a662b176bb
4 changed files with 69 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -147,7 +147,7 @@ Documentation</title>
<table><tr><td><div class="element">Artifact <b>Lumiera</b></div></td></tr></table>
<p>the main executable to be built<br /></p>
<p>Depends on <a href="index.html#refpackage129413"><b>common</b></a></p><p>Depends on <a href="index.html#refpackage129797"><b>gui</b></a></p><p>Depends on <a href="index.html#refpackage129669"><b>proc</b></a></p><p>Depends on <a href="index.html#refpackage129541"><b>backend</b></a></p><p>Stereotype: executable</p>
<p><i>executable</i> associated with : <a href="index.html#refartifact129541"><b>effect</b></a>, <a href="index.html#refartifact131205"><b>buildertool</b></a>, <a href="index.html#refartifact131333"><b>segmentationtool</b></a>, <a href="index.html#refartifact132613"><b>link</b></a>, <a href="index.html#refartifact134405"><b>parameter</b></a>, <a href="index.html#refartifact131973"><b>renderengine</b></a>, <a href="index.html#refartifact134149"><b>glbuf</b></a>, <a href="index.html#refartifact132357"><b>procnode</b></a>, <a href="index.html#refartifact130949"><b>stateproxy</b></a>, <a href="index.html#refartifact128645"><b>edl</b></a>, <a href="index.html#refartifact128773"><b>fixture</b></a>, <a href="index.html#refartifact133253"><b>glpipe</b></a>, <a href="index.html#refartifact128133"><b>main</b></a>, <a href="index.html#refartifact130693"><b>conmanager</b></a>, <a href="index.html#refartifact129413"><b>clip</b></a>, <a href="index.html#refartifact133509"><b>vrender</b></a>, <a href="index.html#refartifact129029"><b>placement</b></a>, <a href="index.html#refartifact128517"><b>sessionimpl</b></a>, <a href="index.html#refartifact130437"><b>builderfacade</b></a>, <a href="index.html#refartifact133893"><b>aframe</b></a>, <a href="index.html#refartifact130821"><b>assembler</b></a>, <a href="index.html#refartifact132485"><b>trafo</b></a>, <a href="index.html#refartifact130053"><b>allocation</b></a>, <a href="index.html#refartifact134021"><b>vframe</b></a>, <a href="index.html#refartifact130565"><b>toolfactory</b></a>, <a href="index.html#refartifact132741"><b>hub</b></a>, <a href="index.html#refartifact131077"><b>buildable</b></a>, <a href="index.html#refartifact129285"><b>abstractmo</b></a>, <a href="index.html#refartifact132229"><b>exitnode</b></a>, <a href="index.html#refartifact131717"><b>pathmanager</b></a>, <a href="index.html#refartifact128901"><b>track</b></a>, <a href="index.html#refartifact129669"><b>meta</b></a>, <a href="index.html#refartifact129797"><b>fixedlocation</b></a>, <a href="index.html#refartifact129925"><b>relativelocation</b></a>, <a href="index.html#refartifact131589"><b>controllerfacade</b></a>, <a href="index.html#refartifact132101"><b>rendergraph</b></a>, <a href="index.html#refartifact133125"><b>pluginadapter</b></a>, <a href="index.html#refartifact129157"><b>explicitplacement</b></a>, <a href="index.html#refartifact130309"><b>auto</b></a>, <a href="index.html#refartifact133637"><b>glrender</b></a>, <a href="index.html#refartifact133381"><b>arender</b></a>, <a href="index.html#refartifact131845"><b>renderstate</b></a>, <a href="index.html#refartifact130181"><b>label</b></a>, <a href="index.html#refartifact131461"><b>nodecreatertool</b></a>, <a href="index.html#refartifact132869"><b>projector</b></a>, <a href="index.html#refartifact134661"><b>interpolator</b></a>, <a href="index.html#refartifact134533"><b>paramprovider</b></a>, <a href="index.html#refartifact132997"><b>mask</b></a>, <a href="index.html#refartifact128261"><b>mobject</b></a>, <a href="index.html#refartifact134277"><b>source</b></a>, <a href="index.html#refartifact133765"><b>frame</b></a></p>
<p><i>executable</i> associated with : <a href="index.html#refartifact129157"><b>explicitplacement</b></a>, <a href="index.html#refartifact130309"><b>auto</b></a>, <a href="index.html#refartifact133637"><b>glrender</b></a>, <a href="index.html#refartifact133381"><b>arender</b></a>, <a href="index.html#refartifact131845"><b>renderstate</b></a>, <a href="index.html#refartifact130181"><b>label</b></a>, <a href="index.html#refartifact131461"><b>nodecreatertool</b></a>, <a href="index.html#refartifact132869"><b>projector</b></a>, <a href="index.html#refartifact134661"><b>interpolator</b></a>, <a href="index.html#refartifact134533"><b>paramprovider</b></a>, <a href="index.html#refartifact132997"><b>mask</b></a>, <a href="index.html#refartifact128261"><b>mobject</b></a>, <a href="index.html#refartifact134277"><b>source</b></a>, <a href="index.html#refartifact133765"><b>frame</b></a>, <a href="index.html#refartifact129541"><b>effect</b></a>, <a href="index.html#refartifact131205"><b>buildertool</b></a>, <a href="index.html#refartifact131333"><b>segmentationtool</b></a>, <a href="index.html#refartifact132613"><b>link</b></a>, <a href="index.html#refartifact134405"><b>parameter</b></a>, <a href="index.html#refartifact131973"><b>renderengine</b></a>, <a href="index.html#refartifact134149"><b>glbuf</b></a>, <a href="index.html#refartifact132357"><b>procnode</b></a>, <a href="index.html#refartifact130949"><b>stateproxy</b></a>, <a href="index.html#refartifact128645"><b>edl</b></a>, <a href="index.html#refartifact128773"><b>fixture</b></a>, <a href="index.html#refartifact133253"><b>glpipe</b></a>, <a href="index.html#refartifact128133"><b>main</b></a>, <a href="index.html#refartifact130693"><b>conmanager</b></a>, <a href="index.html#refartifact129413"><b>clip</b></a>, <a href="index.html#refartifact133509"><b>vrender</b></a>, <a href="index.html#refartifact129029"><b>placement</b></a>, <a href="index.html#refartifact128517"><b>sessionimpl</b></a>, <a href="index.html#refartifact130437"><b>builderfacade</b></a>, <a href="index.html#refartifact133893"><b>aframe</b></a>, <a href="index.html#refartifact130821"><b>assembler</b></a>, <a href="index.html#refartifact132485"><b>trafo</b></a>, <a href="index.html#refartifact130053"><b>allocation</b></a>, <a href="index.html#refartifact134021"><b>vframe</b></a>, <a href="index.html#refartifact130565"><b>toolfactory</b></a>, <a href="index.html#refartifact132741"><b>hub</b></a>, <a href="index.html#refartifact131077"><b>buildable</b></a>, <a href="index.html#refartifact129285"><b>abstractmo</b></a>, <a href="index.html#refartifact132229"><b>exitnode</b></a>, <a href="index.html#refartifact131717"><b>pathmanager</b></a>, <a href="index.html#refartifact128901"><b>track</b></a>, <a href="index.html#refartifact129669"><b>meta</b></a>, <a href="index.html#refartifact129797"><b>fixedlocation</b></a>, <a href="index.html#refartifact129925"><b>relativelocation</b></a>, <a href="index.html#refartifact131589"><b>controllerfacade</b></a>, <a href="index.html#refartifact132101"><b>rendergraph</b></a>, <a href="index.html#refartifact133125"><b>pluginadapter</b></a></p>
<a name="refartifact128133"></a>
<table><tr><td><div class="element">Artifact <b>main</b></div></td></tr></table>
<p>Stereotype: source</p>

View file

@ -22,21 +22,23 @@
#include "lib/test/run.hpp"
#include "lib/test/test-helper.hpp"
#include "proc/mobject/session/scope.hpp"
#include "proc/mobject/session/test-scopes.hpp"
//#include "lib/lumitime.hpp"
//#include "proc/mobject/placement-ref.hpp"
//#include "proc/mobject/placement-index.hpp"
//#include "proc/mobject/test-dummy-mobject.hpp"
//#include "lib/util.hpp"
#include "lib/util.hpp"
//#include <iostream>
#include <iostream>
//#include <string>
//using util::isSameObject;
using util::isSameObject;
//using lumiera::Time;
//using std::string;
//using std::cout;
//using std::endl;
using std::cout;
using std::endl;
namespace mobject {
@ -69,6 +71,65 @@ namespace test {
PIdx index = build_testScopes();
UNIMPLEMENTED ("function test of placement scope interface");
verifyLookup (index);
verifyNavigation (index);
}
typedef PlacementIndex::Query<DummyMO>::iterator _Iter;
/** @test for each Placement in our test "session",
* find the scope and verify it's in line with the index
*/
void
verifyLookup (PIdx ref_index)
{
for (_Iter elm = ref_index.query<DummyMO>(); elm; ++elm)
{
ASSERT (elm->isValid());
cout << *elm << endl;
Scope& scope1 = Scope::containing(*elm);
RefPlacement ref (*elm);
Scope& scope2 = Scope::containing(ref);
// verify this with the scope registered within the index...
PlacementMO& scopeTop = ref_index->getScope(*elm);
ASSERT (scope1 == scopeTop);
ASSERT (scope2 == scopeTop);
ASSERT (scope1 == scope2);
ASSERT (isSameObject (scope1,scope2));
}
}
/** @test navigate to root, starting from each Placement */
void
verifyNavigation (PIdx ref_index)
{
for (_Iter elm = ref_index.query<DummyMO>(); elm; ++elm)
{
Scope& scope = Scope::containing(*elm);
ASSERT (scope == *scope.ascend());
for (Scope::iterator sco = scope.ascend(); sco; ++sco)
if (sco->isRoot())
{
VERIFY_ERROR (INVALID, sco->getParent() );
RefPlacement top = sco->getTop();
RefPlacement root = ref_index->getRoot();
ASSERT (isSameObject (top,root));
}
else
{
Scope& parent = sco->getParent();
RefPlacement top = sco->getTop();
Scope& parentsScope = Scope::containing(top);
RefPlacement topsTop = ref_index->getScope(top); ///////////////////TODO impact of Binding a Sequence? see Ticket #311
ASSERT (topsTop == parentsScope);
ASSERT (isSameObject (topsTop, parentsScope.getTop()));
} }
}
};

View file

@ -41,6 +41,8 @@ classcanvas 130437 class_ref 153989 // QueryResolver
end
note 131333 "this connection is established by the current session"
xyzwh 361 39 2000 158 47
textcanvas 131461 "the \"scope top\""
xyzwh 357 180 2010 73 13
relationcanvas 128389 relation_ref 167557 // <unidirectional association>
from ref 128261 z 1999 stereotype "<<holds>>" xyz 281 219 3000 to ref 128133
no_role_a no_role_b