Navigator: define test cases for path extension after coverage
This commit is contained in:
parent
d5209bfe1d
commit
55c196e5a2
3 changed files with 90 additions and 20 deletions
|
|
@ -369,6 +369,13 @@ namespace interact {
|
|||
return std::move (*this);
|
||||
}
|
||||
|
||||
UICoordResolver&&
|
||||
extend (UICoord const& partialExtensionSpec)
|
||||
{
|
||||
UNIMPLEMENTED ("extend by UI-Coordinates");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** diagnostics */
|
||||
operator string() const { return string(this->uic_); }
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace interact {
|
|||
namespace test {
|
||||
|
||||
// using lumiera::error::LUMIERA_ERROR_WRONG_TYPE;
|
||||
// using lumiera::error::LUMIERA_ERROR_INDEX_BOUNDS;
|
||||
using lumiera::error::LUMIERA_ERROR_INVALID;
|
||||
using lumiera::error::LUMIERA_ERROR_STATE;
|
||||
// using lumiera::error::LUMIERA_ERROR_LOGIC;
|
||||
|
||||
|
|
@ -547,8 +547,8 @@ namespace test {
|
|||
/* === `firstWindow` meta spec is resolved === */
|
||||
UICoordResolver r2 {UICoord::firstWindow().view("blah"), tree};
|
||||
CHECK (0 == r2.coverDepth());
|
||||
CHECK (r2.isAnchored());
|
||||
CHECK (not r2.canCover());
|
||||
CHECK (r2.isAnchored()); // can obviously be anchored, since there is always a first window
|
||||
CHECK (not r2.canCover()); // yet this path is impossible to cover in the current UI
|
||||
CHECK ("UI:firstWindow[*]-*.blah" == string(r2));
|
||||
r2.anchor();
|
||||
CHECK ("UI:window-1[*]-*.blah" == string(r2));
|
||||
|
|
@ -564,34 +564,34 @@ namespace test {
|
|||
r3.anchor();
|
||||
CHECK (not r3.isCovered());
|
||||
CHECK (r3.isCoveredPartially());
|
||||
CHECK (1 == r3.coverDepth());
|
||||
CHECK ("UI:window-3[*]-*.thirdView" == string(r3));
|
||||
CHECK (1 == r3.coverDepth()); // anchoring also picks the second of two possible solutions
|
||||
CHECK ("UI:window-3[*]-*.thirdView" == string(r3)); // thereby covering the "thirdView"
|
||||
|
||||
/* === coverage solution is calculated on demand === */
|
||||
UICoordResolver r4 {UICoord().view("thirdView").append("#2/sub"), tree};
|
||||
CHECK ("UI:?.thirdView.#2/sub" == string(r4));
|
||||
CHECK ("UI:?.thirdView.#2/sub" == string(r4)); // an incomplete path is not automatically resolved
|
||||
CHECK (not r4.isAnchored());
|
||||
CHECK (0 == r4.coverDepth());
|
||||
r4.anchor();
|
||||
CHECK (1 == r4.coverDepth());
|
||||
CHECK (r4.isCoveredPartially());
|
||||
CHECK ("UI:window-3[*]-*.thirdView.#2/sub" == string(r4));
|
||||
r4.anchor(); // but if we anchor, we force search for a coverage solution
|
||||
CHECK (1 == r4.coverDepth()); // which is actually found starting from the third window,
|
||||
CHECK (r4.isCoveredPartially()); // and kept in the internal cache for future use,
|
||||
CHECK ("UI:window-3[*]-*.thirdView.#2/sub" == string(r4)); // but not made explicit, since we only requested anchorage
|
||||
|
||||
/* === already calculated coverage solution is used === */
|
||||
UICoordResolver r5 {UICoord::currentWindow().view("thirdView"), tree};
|
||||
CHECK (not r5.isCovered());
|
||||
CHECK (not r5.isCoveredPartially());
|
||||
CHECK (0 == r5.coverDepth());
|
||||
CHECK (r5.canCover());
|
||||
CHECK (r5.canCover()); // this triggers search for a coverage solution
|
||||
CHECK (1 == r5.coverDepth());
|
||||
CHECK (not r5.isCovered());
|
||||
CHECK (r5.isCoveredPartially());
|
||||
CHECK ("UI:currentWindow[*]-*.thirdView" == string(r5));
|
||||
r5.anchor();
|
||||
r5.anchor(); // and this (cached) solution is also used to make anchorage explicit
|
||||
CHECK ("UI:window-3[*]-*.thirdView" == string(r5));
|
||||
CHECK (1 == r5.coverDepth());
|
||||
CHECK (not r5.isCovered());
|
||||
r5.cover();
|
||||
r5.cover(); // ...now also the coverage solution was made explicit
|
||||
CHECK (r5.isCovered());
|
||||
CHECK (4 == r5.coverDepth());
|
||||
CHECK ("UI:window-3[persp-C]-panelZ.thirdView" == string(r5));
|
||||
|
|
@ -607,10 +607,44 @@ namespace test {
|
|||
}
|
||||
|
||||
|
||||
/** @test mutate given UI coordinates by uncovered extension.
|
||||
* Contrary to just appending something to the path (which is a basic path operation
|
||||
* available on the generic path builder), a _path extension_ is always rooted at the
|
||||
* end of the actually covered part of the UI coordinates. So extending a path implies
|
||||
* search for a coverage solution, followed by truncating the path to the covered part.
|
||||
*/
|
||||
void
|
||||
verify_mutateExtend()
|
||||
{
|
||||
UNIMPLEMENTED ("mutate given UI coordinates by uncovered extension");
|
||||
GenNodeLocationQuery tree{MakeRec()
|
||||
.set("window-2"
|
||||
, MakeRec()
|
||||
.type("persp-B")
|
||||
.set("panelY"
|
||||
, MakeRec())
|
||||
.set("thirdView"
|
||||
, MakeRec()
|
||||
.set("#1", MakeRec())
|
||||
.set("#2", MakeRec())
|
||||
)
|
||||
)
|
||||
};
|
||||
|
||||
/* === extend fully covered explicit path === */
|
||||
UICoordResolver r1 {UICoord{"window-2","persp-B","panelY"}, tree};
|
||||
r1.extend (UICoord().path("engulfed"));
|
||||
cout << string(r1)<<endl;
|
||||
|
||||
/* === extend partially covered path === */
|
||||
UICoordResolver r2 {UICoord().view("thirdView").append("some/where"), tree};
|
||||
r2.extend ("no/where");
|
||||
VERIFY_ERROR (INVALID, r2.extend(UICoord().persp("fisheye")));
|
||||
cout << string(r2)<<endl;
|
||||
|
||||
/* === unsolvable: truncate, extend, recalculate coverage === */
|
||||
UICoordResolver r3 {UICoord().persp("awesome"), tree};
|
||||
r3.extend (UICoord::currentWindow().view("outlandish"));
|
||||
cout << string(r3)<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4206,7 +4206,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1508537003861" ID="ID_846599209" MODIFIED="1515209545852" TEXT="Semantik">
|
||||
<node COLOR="#338800" CREATED="1508537003861" FOLDED="true" ID="ID_846599209" MODIFIED="1515449619533" TEXT="Semantik">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1508537010868" ID="ID_484491629" MODIFIED="1508537050161">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
|
|
@ -4393,8 +4393,8 @@
|
|||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1508539139418" ID="ID_1665843572" MODIFIED="1508539929690" TEXT="Operationen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1508539139418" ID="ID_1665843572" MODIFIED="1515449605990" TEXT="Operationen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1508540055241" ID="ID_565736574" MODIFIED="1508540082134" TEXT="Konventionen">
|
||||
<font ITALIC="true" NAME="SansSerif" SIZE="12"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
|
|
@ -8353,7 +8353,7 @@
|
|||
<node CREATED="1510941687588" ID="ID_601914095" MODIFIED="1510941775002" TEXT="beispielhaft für GenNode umsetzen">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1510941740069" ID="ID_1408571420" MODIFIED="1514292046408" TEXT="erweiterter ChildIter">
|
||||
<node COLOR="#338800" CREATED="1510941740069" FOLDED="true" ID="ID_1408571420" MODIFIED="1515449579377" TEXT="erweiterter ChildIter">
|
||||
<arrowlink COLOR="#283b63" DESTINATION="ID_596422747" ENDARROW="Default" ENDINCLINATION="66;49;" ID="Arrow_ID_1521598219" STARTARROW="Default" STARTINCLINATION="94;-19;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1513560671819" ID="ID_989478065" MODIFIED="1514292039775" TEXT="Interface umstellen">
|
||||
|
|
@ -8648,7 +8648,7 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1514829169777" HGAP="32" ID="ID_331008637" MODIFIED="1515206166911" TEXT="Integration" VSHIFT="10">
|
||||
<node COLOR="#338800" CREATED="1514829169777" FOLDED="true" HGAP="32" ID="ID_331008637" MODIFIED="1515449582667" TEXT="Integration" VSHIFT="10">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1514829220907" FOLDED="true" ID="ID_1488508113" MODIFIED="1515206164636" TEXT="zunächst Algo für partielle Coverage bauen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
|
|
@ -8774,7 +8774,7 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1510941766817" HGAP="13" ID="ID_1117346518" MODIFIED="1515209055245" TEXT="Testfälle" VSHIFT="29">
|
||||
<node COLOR="#338800" CREATED="1510941766817" FOLDED="true" HGAP="13" ID="ID_1117346518" MODIFIED="1515449584843" TEXT="Testfälle" VSHIFT="29">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1513477873206" ID="ID_939423021" MODIFIED="1515206284163" TEXT="definieren was abzudecken ist...">
|
||||
<font ITALIC="true" NAME="SansSerif" SIZE="12"/>
|
||||
|
|
@ -8936,6 +8936,16 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515451105808" ID="ID_1323377531" MODIFIED="1515451115328" TEXT="extend">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1515451117055" ID="ID_602743049" MODIFIED="1515451126326" TEXT="durch explizit gegebenes Suffix">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515451127221" ID="ID_130067342" MODIFIED="1515451168209" TEXT="durch (partielle) UI-Coord spec">
|
||||
<linktarget COLOR="#4f6f95" DESTINATION="ID_130067342" ENDARROW="Default" ENDINCLINATION="544;89;" ID="Arrow_ID_992203487" SOURCE="ID_1736775031" STARTARROW="None" STARTINCLINATION="704;0;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1508538883715" ID="ID_506584428" MODIFIED="1509319976183" TEXT="Basis: LocationQuery">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
|
|
@ -9353,6 +9363,25 @@
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645748" ID="ID_768385613" MODIFIED="1506984662154" TEXT="verify_mutateExtend">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515449655380" ID="ID_1282321814" MODIFIED="1515449740717" TEXT="expliziten Pfad erweitern">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515450991631" ID="ID_1736775031" MODIFIED="1515451168209" TEXT="Pfad durch partielle UI-Coord erweitern">
|
||||
<arrowlink COLOR="#4f6f95" DESTINATION="ID_130067342" ENDARROW="Default" ENDINCLINATION="544;89;" ID="Arrow_ID_992203487" STARTARROW="None" STARTINCLINATION="704;0;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515451047192" ID="ID_554336668" MODIFIED="1515451078845" TEXT="erweitern scheitert wegen Überlapp">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515449669446" ID="ID_1747646759" MODIFIED="1515449741572" TEXT="partially covered erweitern">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515449719015" ID="ID_979130061" MODIFIED="1515449742380" TEXT="unlösbar -> truncate">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515449727142" ID="ID_1936618724" MODIFIED="1515449742948" TEXT="coverage kann dadurch anwachsen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1506182023288" ID="ID_1539184761" MODIFIED="1506182023288" TEXT="ViewSpecDSL_test">
|
||||
|
|
|
|||
Loading…
Reference in a new issue