98 Rec dummyUiStructure = MakeRec()
101 .type(
"perspective-A")
105 .type(
"perspective-B")
106 .
set(
"panelX", MakeRec())
107 .
set(
"panelXX", MakeRec())
113 UICoord uic{
"window-2",
"*",
"panelX",
"someView"};
116 CHECK (not resolver.isCovered());
117 CHECK ( resolver.canCover());
119 UICoord uic2 = resolver.cover()
120 .extend(
"otherView");
122 CHECK (
"UI:window-2[perspective-B]-panelX.otherView" ==
string(uic2));
156 .type(
"perspective-A")
159 .
set(
"firstView", MakeRec())
160 .
set(
"secondView", MakeRec())
165 .type(
"perspective-B")
166 .
set(
"panelY", MakeRec())
170 .type(
"perspective-C")
173 .
set(
"thirdView", MakeRec())
175 .
set(
"panelZZ", MakeRec())
186 CHECK (
"window-2" == queryAPI.determineAnchor(uic1));
187 CHECK (Symbol::BOTTOM == queryAPI.determineAnchor(uic2));
188 CHECK (
"window-1" == queryAPI.determineAnchor(uic3));
189 CHECK (
"window-3" == queryAPI.determineAnchor(uic4));
190 CHECK (
"window-3" == queryAPI.determineAnchor(uic5));
192 CHECK (2 == queryAPI.determineCoverage(uic1));
193 CHECK (0 == queryAPI.determineCoverage(uic2));
194 CHECK (4 == queryAPI.determineCoverage(uic3));
195 CHECK (1 == queryAPI.determineCoverage(uic4));
196 CHECK (3 == queryAPI.determineCoverage(uic5));
198 LocationQuery::ChildIter cii = queryAPI.getChildren(uic3, 3);
199 CHECK (not isnil(cii));
200 CHECK (
"firstView" == *cii);
202 CHECK (
"secondView" == *cii);
203 CHECK (not isnil(cii));
207 CHECK (
"window-1, window-2, window-3" == join (queryAPI.getChildren (uic3, 0)));
208 CHECK (
"perspective-A" == join (queryAPI.getChildren (uic3, 1)));
209 CHECK (
"panelX" == join (queryAPI.getChildren (uic3, 2)));
210 CHECK (
"firstView, secondView" == join (queryAPI.getChildren (uic3, 3)));
211 CHECK (isnil ( queryAPI.getChildren (uic3, 4)));
213 CHECK (
"window-1, window-2, window-3" == join (queryAPI.getChildren (uic2, 0)));
216 CHECK (
"window-1, window-2, window-3" == join (queryAPI.getChildren (uic5, 0)));
217 CHECK (
"perspective-C" == join (queryAPI.getChildren (uic5, 1)));
218 CHECK (
"panelZ, panelZZ" == join (queryAPI.getChildren (uic5, 2)));
219 CHECK (
"thirdView" == join (queryAPI.getChildren (uic5, 3)));
224 cii = queryAPI.getChildren (uic3, 0);
225 CHECK (
"window-1" == *cii);
226 CHECK (0 == cii.depth());
227 cii.expandChildren();
228 CHECK (1 == cii.depth());
229 CHECK (
"perspective-A" == *cii);
230 cii.expandChildren();
231 CHECK (2 == cii.depth());
232 CHECK (
"panelX" == *cii);
233 cii.expandChildren();
234 CHECK (3 == cii.depth());
235 CHECK (
"firstView" == *cii);
236 CHECK (
"firstView, secondView, window-2, window-3" == join (cii));
252 .type(
"perspective-A")
256 .type(
"perspective-B")
259 .
set(
"someView", MakeRec())
277 CHECK ( r1.isAnchored());
278 CHECK (not r2.isAnchored());
279 CHECK ( r3.isAnchored());
280 CHECK ( r4.isAnchored());
281 CHECK ( r5.isAnchored());
282 CHECK (not r6.isAnchored());
284 CHECK ( r1.canAnchor());
285 CHECK (not r2.canAnchor());
286 CHECK ( r3.canAnchor());
287 CHECK ( r4.canAnchor());
288 CHECK ( r5.canAnchor());
289 CHECK ( r6.canAnchor());
337 .
set(
"firstView", MakeRec())
338 .
set(
"secondView", MakeRec())
344 .
set(
"#1", MakeRec())
345 .
set(
"#2", MakeRec())
346 .
set(
"tab", MakeRec())
353 .
set(
"panelY", MakeRec())
364 .
set(
"sub", MakeRec())
366 .
set(
"#1", MakeRec())
369 .
set(
"panelZZ", MakeRec())
376 .
panel(
"panelX"), tree};
377 CHECK (r11.isCovered());
378 CHECK (3 == r11.coverDepth());
384 .
view(
"thirdView"), tree};
385 CHECK (not r12.isCovered());
386 CHECK ( r12.isCoveredPartially());
387 CHECK (3 ==r12.coverDepth());
388 CHECK (
"UI:window-1[persp-A]-panelX.thirdView" ==
string(r12));
391 CHECK (r12.isCovered());
392 CHECK (r12.isCoveredPartially());
393 CHECK (3 ==r12.coverDepth());
394 CHECK (
"UI:window-1[persp-A]-panelX" ==
string(r12));
399 CHECK (
"UI:firstWindow[persp-A]" ==
string(r21));
401 CHECK (
"UI:window-1[persp-A]" ==
string(r21));
405 CHECK (
"UI:window-3" ==
string(r22.cover()));
410 CHECK (
"UI:window-1[*]-*.secondView" ==
string(r31));
411 CHECK (0 ==r31.coverDepth());
412 CHECK (not r31.isCovered());
413 CHECK (r31.canCover());
415 CHECK (r31.isCovered());
416 CHECK (4 == r31.coverDepth());
417 CHECK (
"UI:window-1[persp-A]-panelX.secondView" ==
string(r31));
421 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab/sub" ==
string(r32.cover()));
425 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.#2" ==
string(r33.cover()));
429 CHECK (
"UI:currentWindow[*]-panelZ.*.tab" ==
string(r34));
430 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab" ==
string(r34.cover()));
433 CHECK (
"UI:currentWindow[.]-panelZ.*.tab" ==
string(r35));
434 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab" ==
string(r35.cover()));
437 CHECK (
"UI:currentWindow[*]-..nonexisting" ==
string(r36));
438 CHECK (
"UI:window-3[persp-C]-panelZ" ==
string(r36.cover()));
443 CHECK (
"UI:window-2" ==
string(r41));
446 CHECK (
"UI:window-2[*]-*" ==
string(r41));
447 CHECK (not r41.canCover());
448 CHECK (
"UI:window-2" ==
string(r41.cover()));
452 CHECK (not r42.canCover());
456 CHECK (not r43.canCover());
460 CHECK (not r44.canCover());
464 CHECK (not r45.canCover());
468 CHECK (not r46.canCover());
472 CHECK (not r47.canCover());
477 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.tab/sub" ==
string(r51.cover()));
481 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.tab" ==
string(r52.cover()));
485 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.#1" ==
string(r531.cover()));
488 CHECK (
"UI:window-1[persp-A]-panelZ.thirdView.tab" ==
string(r532.cover()));
491 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView.#1" ==
string(r533.cover()));
514 .
set(
"#1", MakeRec())
515 .
set(
"#2", MakeRec())
523 CHECK (3 == r1.coverDepth());
525 CHECK (not r1.isCovered());
526 CHECK (3 == r1.coverDepth());
527 CHECK (r1.isCoveredPartially());
528 CHECK (
"UI:window-2[persp-B]-panelY.otherView.tab" ==
string(r1));
530 CHECK (r1.isCovered());
531 CHECK (
"UI:window-2[persp-B]-panelY" ==
string(r1));
535 CHECK (0 == r2.coverDepth());
537 CHECK (not r2.isCovered());
538 CHECK (4 == r2.coverDepth());
539 CHECK (r2.isCoveredPartially());
540 CHECK (
"UI:window-2[persp-B]-panelY.someView.#3/sub" ==
string(r2));
542 CHECK (
"UI:window-2[persp-B]-panelY.someView" ==
string(r2));
546 CHECK (not r3.canCover());
557 CHECK (
"UI:currentWindow[.]-fantasy.fantomas" ==
string(r5));
558 CHECK (1 == r5.coverDepth());
560 CHECK (not r5.isCovered());
561 CHECK (2 == r5.coverDepth());
562 CHECK (r5.isCoveredPartially());
563 CHECK (
"UI:window-2[persp-B]-fantasy.fantomas" ==
string(r5));
565 CHECK (
"UI:window-2[persp-B]" ==
string(r5));
566 CHECK (2 == r5.coverDepth());
592 .
set(
"firstView", MakeRec())
593 .
set(
"secondView", MakeRec())
603 .
set(
"#1", MakeRec())
604 .
set(
"#2", MakeRec())
613 .
set(
"thirdView", MakeRec())
620 CHECK (3 == r1.coverDepth());
622 CHECK (
"UI:window-2[persp-B]-panelY" ==
string(r1));
626 CHECK (0 == r2.coverDepth());
627 CHECK (r2.isAnchored());
628 CHECK (not r2.canCover());
629 CHECK (
"UI:firstWindow[*]-*.blah" ==
string(r2));
631 CHECK (
"UI:window-1[*]-*.blah" ==
string(r2));
632 CHECK (0 == r2.coverDepth());
633 CHECK (not r2.canCover());
637 CHECK (0 == r3.coverDepth());
638 CHECK (r3.isAnchored());
639 CHECK (not r3.isCovered());
640 CHECK (r3.canCover());
642 CHECK (not r3.isCovered());
643 CHECK (r3.isCoveredPartially());
644 CHECK (1 == r3.coverDepth());
645 CHECK (
"UI:window-3[*]-*.thirdView" ==
string(r3));
649 CHECK (
"UI:?.thirdView.#2/sub" ==
string(r4));
650 CHECK (not r4.isAnchored());
651 CHECK (0 == r4.coverDepth());
653 CHECK (1 == r4.coverDepth());
654 CHECK (r4.isCoveredPartially());
655 CHECK (
"UI:window-2[*]-*.thirdView.#2/sub" ==
string(r4));
659 CHECK (not r5.isCovered());
660 CHECK (not r5.isCoveredPartially());
661 CHECK (0 == r5.coverDepth());
662 CHECK (r5.canCover());
663 CHECK (1 == r5.coverDepth());
664 CHECK (not r5.isCovered());
665 CHECK (r5.isCoveredPartially());
666 CHECK (
"UI:currentWindow[*]-*.thirdView" ==
string(r5));
668 CHECK (
"UI:window-3[*]-*.thirdView" ==
string(r5));
669 CHECK (1 == r5.coverDepth());
670 CHECK (not r5.isCovered());
672 CHECK (r5.isCovered());
673 CHECK (4 == r5.coverDepth());
674 CHECK (
"UI:window-3[persp-C]-panelZ.thirdView" ==
string(r5));
678 CHECK (not r6.isAnchored());
679 CHECK (not r6.canCover());
681 CHECK (not r6.isAnchored());
682 CHECK (0 == r6.coverDepth());
683 CHECK (
"UI:windows[*]-*.*.*/to/hell" ==
string(r6));
708 .
set(
"#1", MakeRec())
709 .
set(
"#2", MakeRec())
717 CHECK (
"UI:window-2[persp-B]-panelY" ==
string(r1));
718 CHECK (r1.isCovered());
719 r1.extend (
UICoord().path(
"gappy").tab(2));
720 CHECK (
"UI:window-2[persp-B]-panelY.*.#2/gappy" ==
string(r1));
721 r1.extend (
"seamless");
722 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.#2/seamless" ==
string(r1));
726 CHECK (
"UI:?.thirdView.some/where" ==
string(r2));
727 r2.extend (
"no/where");
728 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.no/where" ==
string(r2));
729 CHECK (r2.isCoveredPartially());
733 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.no/where" ==
string(r2));
735 r2.extend(
UICoord().tab(
"nada"));
736 CHECK (
"UI:window-2[persp-B]-panelY.thirdView.nada" ==
string(r2));
738 CHECK (
"UI:window-2[persp-B]-panelY.thirdView" ==
string(r2));
742 CHECK (not r3.canCover());
743 CHECK (0 == r3.coverDepth());
745 CHECK (1 == r3.coverDepth());
746 CHECK (
"UI:currentWindow[*]-*.*.#1" ==
string(r3));
Test/Diagnostics: implementation of the LocationQuery-API based on a abstract topological structure g...
Describe a location within the UI through structural/topological coordinates.
Builder && path(Literal pathDef)
augment UI coordinates to define a complete local path
Builder persp(Literal perspectiveID) const
Implementation of the stage::interact::LocationQuery interface to work on a GenNode tree...
void verify_mutateAnchor()
void verify_backingQuery()
Builder && persp(Literal perspectiveID)
augment UI coordinates to mandate a specific perspective to be active within the window ...
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Builder && append(Literal elm)
augment UI coordinates by appending a further component at the end.
void verify_mutateCoverage()
const Symbol UIC_ELIDED
indicate that a component is elided or irrelevant here
Builder && tab(Literal tabID)
augment UI coordinates to indicate a specific tab within the view"
Token or Atom with distinct identity.
Builder && panel(Literal panelID)
augment UI coordinates to indicate a specific view to be used
Simple test class runner.
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A topological addressing scheme to designate structural locations within the UI.
Query and mutate UICoord specifications in relation to actual UI topology.
Generic building block for tree shaped (meta)data structures.
void verify_simpleUsage()
A collection of frequently used helper functions to support unit testing.
void verify_mutateCoverPartially()
Builder && view(Literal viewID)
augment UI coordinates to indicate a specific view to be used
static Builder window(Literal windowID)
Builder: start definition of UI-Coordinates rooted in given window.
Evaluation of UI coordinates against a concrete window topology.
object-like record of data.
static Builder firstWindow()
Builder: start definition of UI-Coordinates rooted in the firstWindow
void verify_queryAnchor()
static Builder currentWindow()
Builder: start definition of UI-Coordinates rooted in the currentWindow
void verify_mutateExtend()