Navigator: cook up some interesting test cases for anchor mutation
...and yes, even writing seemingly superfluous test cases will uncover yet another bug
This commit is contained in:
parent
2665ad5bf3
commit
837aa81fc5
2 changed files with 92 additions and 28 deletions
|
|
@ -510,45 +510,93 @@ namespace test {
|
|||
.set("firstView", MakeRec())
|
||||
.set("secondView", MakeRec())
|
||||
)
|
||||
.set("panelZ"
|
||||
, MakeRec()
|
||||
.set("thirdView"
|
||||
, MakeRec()
|
||||
.set("#1", MakeRec())
|
||||
.set("#2", MakeRec())
|
||||
.set("tab", MakeRec())
|
||||
)
|
||||
)
|
||||
)
|
||||
.set("window-2"
|
||||
, MakeRec()
|
||||
.type("persp-B")
|
||||
.set("panelY", MakeRec())
|
||||
.set("panelY"
|
||||
, MakeRec())
|
||||
.set("thirdView"
|
||||
, MakeRec()
|
||||
.set("#1", MakeRec())
|
||||
.set("#2", MakeRec())
|
||||
)
|
||||
)
|
||||
.set("window-3"
|
||||
, MakeRec()
|
||||
.type("persp-C")
|
||||
.set("panelZ"
|
||||
, MakeRec()
|
||||
.set("thirdView"
|
||||
, MakeRec()
|
||||
.set("tab"
|
||||
, MakeRec()
|
||||
.set("sub", MakeRec())
|
||||
)
|
||||
.set("#1", MakeRec())
|
||||
)
|
||||
.set("thirdView", MakeRec())
|
||||
)
|
||||
.set("panelZZ", MakeRec())
|
||||
)
|
||||
};
|
||||
|
||||
/* === explicitly given window spec remains unchanged === */
|
||||
UICoordResolver r1 {UICoord{"window-2","persp-B","panelY"}, tree};
|
||||
CHECK (3 == r1.coverDepth());
|
||||
r1.anchor();
|
||||
CHECK ("UI:window-2[persp-B]-panelY" == string(r1));
|
||||
|
||||
/* === `firstWindow` meta spec is resolved === */
|
||||
UICoordResolver r2 {UICoord::firstWindow().view("blah"), tree};
|
||||
CHECK (0 == r2.coverDepth());
|
||||
CHECK (r2.isAnchored());
|
||||
CHECK (not r2.canCover());
|
||||
CHECK ("UI:firstWindow[*]-*.blah" == string(r2));
|
||||
r2.anchor();
|
||||
CHECK ("UI:window-1[*]-*.blah" == string(r2));
|
||||
CHECK (0 == r2.coverDepth());
|
||||
CHECK (not r2.canCover());
|
||||
|
||||
/* === `currentWindow` meta spec is resolved === */
|
||||
/* === already calculated coverage solution is used === */
|
||||
UICoordResolver r3 {UICoord::currentWindow().view("thirdView"), tree};
|
||||
CHECK (0 == r3.coverDepth());
|
||||
CHECK (r3.isAnchored());
|
||||
CHECK (not r3.isCovered());
|
||||
CHECK (r3.canCover());
|
||||
r3.anchor();
|
||||
CHECK (not r3.isCovered());
|
||||
CHECK (r3.isCoveredPartially());
|
||||
CHECK (1 == r3.coverDepth());
|
||||
CHECK ("UI:window-3[*]-*.thirdView" == string(r3));
|
||||
|
||||
/* === coverage solution is calculated on demand === */
|
||||
UICoordResolver r4 {UICoord().view("thirdView").append("#2/sub"), tree};
|
||||
CHECK (not r4.isAnchored());
|
||||
CHECK (0 == r4.coverDepth());
|
||||
r4.anchor();
|
||||
CHECK (1 == r4.coverDepth());
|
||||
CHECK (r4.isCoveredPartially());
|
||||
cout << r4 <<endl;
|
||||
|
||||
/* === 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 (1 == r5.coverDepth());
|
||||
CHECK (not r5.isCovered());
|
||||
CHECK (r5.isCoveredPartially());
|
||||
cout << r5 <<endl;
|
||||
r5.anchor();
|
||||
cout << r5 <<endl;
|
||||
CHECK (1 == r5.coverDepth());
|
||||
CHECK (not r5.isCovered());
|
||||
r5.cover();
|
||||
CHECK (r5.isCovered());
|
||||
CHECK (4 == r5.coverDepth());
|
||||
cout << r5 <<endl;
|
||||
|
||||
/* === impossible to cover and can not be anchored === */
|
||||
UICoordResolver r6 {UICoord::window("windows").path("to/hell"), tree};
|
||||
CHECK (not r6.isAnchored());
|
||||
CHECK (not r6.canCover());
|
||||
r6.anchor();
|
||||
CHECK (not r6.isAnchored());
|
||||
CHECK (0 == r6.coverDepth());
|
||||
cout << r6 << endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9252,22 +9252,38 @@
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1506984645748" ID="ID_1171284706" MODIFIED="1506984663361" TEXT="verify_mutateAnchor">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287623841" ID="ID_11774693" MODIFIED="1515287734866" TEXT="explizit verankert: ändert sich nix">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1515287623841" ID="ID_11774693" MODIFIED="1515290983628" TEXT="explizit verankert: ändert sich nix">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287648717" ID="ID_293459284" MODIFIED="1515287736050" TEXT="firstWindow explizit machen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1515287648717" ID="ID_293459284" MODIFIED="1515290985688" TEXT="firstWindow explizit machen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1515291045220" ID="ID_907726638" MODIFIED="1515291066019" TEXT="...selbst wenn sonst nicht lösbar">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1515287660188" ID="ID_811260333" MODIFIED="1515290994597" TEXT="currentWindow explizit machen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1515291071497" ID="ID_913736296" MODIFIED="1515291083841" TEXT="...und trägt auch zur Lösung bei">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287660188" ID="ID_811260333" MODIFIED="1515287736850" TEXT="currentWindow explizit machen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287665939" ID="ID_525267705" MODIFIED="1515287738746" TEXT="lösbare coverage">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287701126" ID="ID_1257691503" MODIFIED="1515289604179" TEXT="noch nicht berechnet: errechnen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1515291242698" ID="ID_512594119" MODIFIED="1515291278142" TEXT="muß re-normalisieren">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1515291264591" ID="ID_250465802" MODIFIED="1515291278998" TEXT="sollte dann coverDepth neu errechnen">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287694871" ID="ID_953283273" MODIFIED="1515287741026" TEXT="schon berechnet: eintragen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1515291343277" ID="ID_1704851738" MODIFIED="1515291349128" TEXT="explizites Cover machen"/>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1515291350332" ID="ID_219986282" MODIFIED="1515291362081" TEXT="neue coverDepth muß sichtbar werden">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287701126" ID="ID_1257691503" MODIFIED="1515287740146" TEXT="noch nicht berechnet: errechnen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1515287717092" ID="ID_459525933" MODIFIED="1515287743561" TEXT="nicht coverbar: ändert sich nix">
|
||||
|
|
|
|||
Loading…
Reference in a new issue