55 using LERR_(WRONG_TYPE);
56 using LERR_(BOTTOM_VALUE);
60 const double PI = 3.14159265358979323846264338328;
111 CHECK (42 == n1.data.get<
int>());
112 CHECK (!n1.isNamed());
113 CHECK (contains (n1.idi.getSym(),
"_CHILD_"));
114 CHECK (contains (
name(n1),
"_CHILD_"));
118 CHECK (almostEqual (PI, n2.data.get<
double>()));
119 CHECK (n2.isNamed());
120 CHECK (
"π" == n2.idi.getSym());
121 CHECK (
"π" ==
name(n2));
126 CHECK (42 == n11.data.get<
int>());
131 CHECK (24 == n11.data.get<
int>());
132 CHECK (42 == n1.data.get<
int>());
143 CHECK (
"spam" == n3.data.get<
Rec>().getType());
144 CHECK (
"eggs" == n3.data.get<
Rec>().get(
"ham").data.get<
string>());
145 CHECK (
"ham" == n3.data.get<
Rec>().get(
"ham").idi.getSym());
146 CHECK (n3.data.get<
Rec>().get(
"ham").isNamed());
147 CHECK (!n3.isNamed());
159 auto o1 =
MakeRec().genNode(
"νόμος");
160 auto o2 =
MakeRec().type(
"spam").genNode();
161 auto o3 =
MakeRec().attrib(
"Ψ", int64_t(42),
"π", 3.14159265358979323846264338328).genNode(
"μάθησις");
163 CHECK (!o0.isNamed());
164 CHECK (isnil(o0.data.get<
Rec>()));
165 CHECK (
"NIL" == o0.data.get<
Rec>().getType());
167 CHECK (o1.isNamed());
168 CHECK (
"νόμος" == o1.idi.getSym());
169 CHECK (isnil(o1.data.get<
Rec>()));
171 CHECK (!o2.isNamed());
172 CHECK (
"spam" == o2.data.get<
Rec>().getType());
173 CHECK (isnil(o2.data.get<
Rec>()));
175 CHECK (o3.isNamed());
176 CHECK (
"μάθησις" == o3.idi.getSym());
177 CHECK (
"NIL" == o3.data.get<
Rec>().getType());
178 CHECK (
GenNode(
"Ψ", int64_t(42)) == o3.data.get<
Rec>().get(
"Ψ"));
179 CHECK (42L == o3.data.get<
Rec>().get(
"Ψ").data.get<int64_t>());
180 CHECK (almostEqual (PI, o3.data.get<
Rec>().get(
"π").data.get<
double>()));
190 ,
MakeRec().type(
"ham").scope(
"eggs").genNode())
191 .genNode(
"baked beans");
193 CHECK (o4.isNamed());
194 CHECK (
"baked beans" == o4.idi.getSym());
195 CHECK (
"spam" == o4.data.get<
Rec>().getType());
197 auto scope = o4.data.get<
Rec>().scope();
198 CHECK (!isnil(scope));
201 CHECK (
char(
'*') == scope->data.get<
char>());
203 CHECK (
"★" == scope->data.get<
string>());
205 CHECK (luid == scope->data.get<
LuidH>());
207 CHECK (
Time(920,0) == scope->data.get<
TimeSpan>().end());
211 CHECK (
"ham" == spam.data.get<
Rec>().getType());
212 CHECK (spam.contains (
"eggs"));
216 CHECK (isnil(o2.data.get<
Rec>()));
220 auto o5 =
MakeRec().genNode(veryspecialID);
221 CHECK (o5 !=
MakeRec().genNode());
222 CHECK (o5 !=
MakeRec().genNode(
"quasi niente"));
223 CHECK (o5 ==
MakeRec().genNode(veryspecialID));
224 CHECK (
name(o5) ==
"quasi_niente");
225 CHECK (o5.idi == veryspecialID);
233 GenNode ham =
MakeRec().type(
"spam").attrib(
"τ",
Time(23,42)).genNode(
"egg bacon sausage and spam");
236 CHECK (hamID == ham.idi);
237 CHECK (hamID.getSym() == ham.idi.getSym());
238 CHECK (hamID.getHash() == ham.idi.getHash());
239 CHECK (contains (
string(hamID),
"spam"));
241 Ref ref1(
"egg bacon sausage and spam");
244 CHECK (ref1.idi == ham.idi);
245 CHECK (ref2.idi == ham.idi);
248 Rec& hamRef = ham.data.get<
Rec>();
249 CHECK (isSameObject (hamRef, ref2.data.get<
Rec>()));
258 CHECK (isSameObject(hamRef, ham_ref));
259 CHECK (isSameObject(hamRef, *rr2.get()));
282 .scope(
"eggs",
"spam",
"spam")
286 .attrib(
"hasSpam",
true)
287 .genNode(
"baked beans");
290 cout <<
"--spam--"<<endl;
294 CHECK (
renderCompact(n) ==
"{hasSpam=true|*, ★, 3.1415927, ham{|eggs, spam, spam}, 0:00:00.000≺920ms≻, 42}"_expect);
297 auto iter = n.begin();
298 CHECK (!isnil (
iter));
299 CHECK (1 ==
iter.level());
300 CHECK (
"baked beans" ==
iter->idi.getSym());
301 CHECK (Rec::TYPE_NIL ==
iter->data.get<
Rec>().getType());
304 CHECK (2 == iter.level());
305 CHECK (
"hasSpam" == iter->idi.getSym());
306 CHECK (
true == iter->data.get<
bool>());
307 CHECK (
"GenNode-ID(\"hasSpam\")-DataCap|«bool»|true" ==
string(*iter));
310 CHECK (!iter->isNamed());
311 CHECK (
'*' == iter->data.get<
char>());
314 CHECK (!iter->isNamed());
315 CHECK (
"★" == iter->data.get<
string>());
318 CHECK (!iter->isNamed());
319 CHECK (almostEqual (PI, iter->data.get<
double>()));
322 CHECK (
"spam" == iter->idi.getSym());
323 CHECK (
"ham" == iter->data.get<
Rec>().getType());
326 CHECK (3 == iter.level());
327 CHECK (
"eggs" == iter->data.get<
string>());
330 CHECK (
"spam" == iter->data.get<
string>());
333 CHECK (
"spam" == iter->data.get<
string>());
334 CHECK (3 == iter.level());
337 CHECK (2 == iter.level());
338 CHECK (!iter->isNamed());
339 CHECK (
"0:00:00.000≺920ms≻" ==
string(iter->data.get<
TimeSpan>()));
341 CHECK (!iter->isNamed());
342 CHECK (42 == iter->data.get<int64_t>());
343 CHECK (2 == iter.level());
346 CHECK (0 == iter.level());
347 CHECK (isnil (iter));
353 auto child = childData(n);
354 CHECK (!isnil (child));
355 CHECK (
'*' == child->get<
char>());
358 CHECK (
"★" == child->get<
string>());
361 CHECK (almostEqual (PI, child->get<
double>()));
364 CHECK (
"ham" == child->get<
Rec>().getType());
365 CHECK (
"eggs" == child->get<
Rec>().child(0).data.get<
string>());
371 CHECK (42 == child->get<int64_t>());
374 CHECK (isnil (child));
376 CHECK (n.hasChildren());
377 CHECK (not
GenNode{42}.hasChildren());
386 int64_t l1 = 64;
GenNode nl1(l1);
387 int64_t l2 = 126;
GenNode nl2(l2);
388 short r1 = 64;
GenNode nr1(r1);
389 short r2 = 126;
GenNode nr2(r2);
390 double d1 = 64;
GenNode nd1(d1);
391 double d2 = 126;
GenNode nd2(d2);
392 char c1 =
'@';
GenNode nc1(c1);
393 char c2 =
'~';
GenNode nc2(c2);
394 bool b1 =
true;
GenNode nb1(b1);
395 bool b2 =
false;
GenNode nb2(b2);
396 string s1 =
"";
GenNode ns1(s1);
397 string s2 =
"↯";
GenNode ns2(s2);
432 CHECK (nto1 == nto1);
433 CHECK (nto2 == nto2);
434 CHECK (ntd1 == ntd1);
435 CHECK (ntd2 == ntd2);
436 CHECK (nts1 == nts1);
437 CHECK (nts2 == nts2);
440 CHECK (rec1 == rec1);
441 CHECK (rec2 == rec2);
442 CHECK (ref1 == ref1);
443 CHECK (ref2 == ref2);
445 CHECK (ni1 != ni2); CHECK (ni2 != ni1);
446 CHECK (nl1 != nl2); CHECK (nl2 != nl1);
447 CHECK (nr1 != nr2); CHECK (nr2 != nr1);
448 CHECK (nd1 != nd2); CHECK (nd2 != nd1);
449 CHECK (nc1 != nc2); CHECK (nc2 != nc1);
450 CHECK (nb1 != nb2); CHECK (nb2 != nb1);
451 CHECK (ns1 != ns2); CHECK (ns2 != ns1);
452 CHECK (nt1 != nt2 ); CHECK (nt2 != nt1 );
453 CHECK (nto1 != nto2); CHECK (nto2 != nto1);
454 CHECK (ntd1 != ntd2); CHECK (ntd2 != ntd1);
455 CHECK (nts1 != nts2); CHECK (nts2 != nts1);
456 CHECK (nh1 != nh2 ); CHECK (nh2 != nh1 );
457 CHECK (rec1 != rec2); CHECK (rec2 != rec1);
458 CHECK (ref1 != ref2); CHECK (ref2 != ref1);
460 CHECK (ni1 != ni2); CHECK (ni2 != ni1);
461 CHECK (ni1 != nl1); CHECK (nl1 != ni1);
462 CHECK (ni1 != nl2); CHECK (nl2 != ni1);
463 CHECK (ni1 != nr1); CHECK (nr1 != ni1);
464 CHECK (ni1 != nr2); CHECK (nr2 != ni1);
465 CHECK (ni1 != nd1); CHECK (nd1 != ni1);
466 CHECK (ni1 != nd2); CHECK (nd2 != ni1);
467 CHECK (ni1 != nc1); CHECK (nc1 != ni1);
468 CHECK (ni1 != nc2); CHECK (nc2 != ni1);
469 CHECK (ni1 != nb1); CHECK (nb1 != ni1);
470 CHECK (ni1 != nb2); CHECK (nb2 != ni1);
471 CHECK (ni1 != ns1); CHECK (ns1 != ni1);
472 CHECK (ni1 != ns2); CHECK (ns2 != ni1);
473 CHECK (ni1 != nt1 ); CHECK (nt1 != ni1);
474 CHECK (ni1 != nt2 ); CHECK (nt2 != ni1);
475 CHECK (ni1 != nto1); CHECK (nto1 != ni1);
476 CHECK (ni1 != nto2); CHECK (nto2 != ni1);
477 CHECK (ni1 != ntd1); CHECK (ntd1 != ni1);
478 CHECK (ni1 != ntd2); CHECK (ntd2 != ni1);
479 CHECK (ni1 != nts1); CHECK (nts1 != ni1);
480 CHECK (ni1 != nts2); CHECK (nts2 != ni1);
481 CHECK (ni1 != nh1 ); CHECK (nh1 != ni1);
482 CHECK (ni1 != nh2 ); CHECK (nh2 != ni1);
483 CHECK (ni1 != rec1); CHECK (rec1 != ni1);
484 CHECK (ni1 != rec2); CHECK (rec2 != ni1);
485 CHECK (ni1 != ref1); CHECK (ref1 != ni1);
486 CHECK (ni1 != ref2); CHECK (ref2 != ni1);
488 CHECK (ni2 != nl1); CHECK (nl1 != ni2);
489 CHECK (ni2 != nl2); CHECK (nl2 != ni2);
490 CHECK (ni2 != nr1); CHECK (nr1 != ni2);
491 CHECK (ni2 != nr2); CHECK (nr2 != ni2);
492 CHECK (ni2 != nd1); CHECK (nd1 != ni2);
493 CHECK (ni2 != nd2); CHECK (nd2 != ni2);
494 CHECK (ni2 != nc1); CHECK (nc1 != ni2);
495 CHECK (ni2 != nc2); CHECK (nc2 != ni2);
496 CHECK (ni2 != nb1); CHECK (nb1 != ni2);
497 CHECK (ni2 != nb2); CHECK (nb2 != ni2);
498 CHECK (ni2 != ns1); CHECK (ns1 != ni2);
499 CHECK (ni2 != ns2); CHECK (ns2 != ni2);
500 CHECK (ni2 != nt1 ); CHECK (nt1 != ni2);
501 CHECK (ni2 != nt2 ); CHECK (nt2 != ni2);
502 CHECK (ni2 != nto1); CHECK (nto1 != ni2);
503 CHECK (ni2 != nto2); CHECK (nto2 != ni2);
504 CHECK (ni2 != ntd1); CHECK (ntd1 != ni2);
505 CHECK (ni2 != ntd2); CHECK (ntd2 != ni2);
506 CHECK (ni2 != nts1); CHECK (nts1 != ni2);
507 CHECK (ni2 != nts2); CHECK (nts2 != ni2);
508 CHECK (ni2 != nh1 ); CHECK (nh1 != ni2);
509 CHECK (ni2 != nh2 ); CHECK (nh2 != ni2);
510 CHECK (ni2 != rec1); CHECK (rec1 != ni2);
511 CHECK (ni2 != rec2); CHECK (rec2 != ni2);
512 CHECK (ni2 != ref1); CHECK (ref1 != ni2);
513 CHECK (ni2 != ref2); CHECK (ref2 != ni2);
515 CHECK (nl1 != nl2); CHECK (nl2 != nl1);
516 CHECK (nl1 != nr1); CHECK (nr1 != nl1);
517 CHECK (nl1 != nr2); CHECK (nr2 != nl1);
518 CHECK (nl1 != nd1); CHECK (nd1 != nl1);
519 CHECK (nl1 != nd2); CHECK (nd2 != nl1);
520 CHECK (nl1 != nc1); CHECK (nc1 != nl1);
521 CHECK (nl1 != nc2); CHECK (nc2 != nl1);
522 CHECK (nl1 != nb1); CHECK (nb1 != nl1);
523 CHECK (nl1 != nb2); CHECK (nb2 != nl1);
524 CHECK (nl1 != ns1); CHECK (ns1 != nl1);
525 CHECK (nl1 != ns2); CHECK (ns2 != nl1);
526 CHECK (nl1 != nt1 ); CHECK (nt1 != nl1);
527 CHECK (nl1 != nt2 ); CHECK (nt2 != nl1);
528 CHECK (nl1 != nto1); CHECK (nto1 != nl1);
529 CHECK (nl1 != nto2); CHECK (nto2 != nl1);
530 CHECK (nl1 != ntd1); CHECK (ntd1 != nl1);
531 CHECK (nl1 != ntd2); CHECK (ntd2 != nl1);
532 CHECK (nl1 != nts1); CHECK (nts1 != nl1);
533 CHECK (nl1 != nts2); CHECK (nts2 != nl1);
534 CHECK (nl1 != nh1 ); CHECK (nh1 != nl1);
535 CHECK (nl1 != nh2 ); CHECK (nh2 != nl1);
536 CHECK (nl1 != rec1); CHECK (rec1 != nl1);
537 CHECK (nl1 != rec2); CHECK (rec2 != nl1);
538 CHECK (nl1 != ref1); CHECK (ref1 != nl1);
539 CHECK (nl1 != ref2); CHECK (ref2 != nl1);
541 CHECK (nl2 != nr1); CHECK (nr1 != nl2);
542 CHECK (nl2 != nr2); CHECK (nr2 != nl2);
543 CHECK (nl2 != nd1); CHECK (nd1 != nl2);
544 CHECK (nl2 != nd2); CHECK (nd2 != nl2);
545 CHECK (nl2 != nc1); CHECK (nc1 != nl2);
546 CHECK (nl2 != nc2); CHECK (nc2 != nl2);
547 CHECK (nl2 != nb1); CHECK (nb1 != nl2);
548 CHECK (nl2 != nb2); CHECK (nb2 != nl2);
549 CHECK (nl2 != ns1); CHECK (ns1 != nl2);
550 CHECK (nl2 != ns2); CHECK (ns2 != nl2);
551 CHECK (nl2 != nt1 ); CHECK (nt1 != nl2);
552 CHECK (nl2 != nt2 ); CHECK (nt2 != nl2);
553 CHECK (nl2 != nto1); CHECK (nto1 != nl2);
554 CHECK (nl2 != nto2); CHECK (nto2 != nl2);
555 CHECK (nl2 != ntd1); CHECK (ntd1 != nl2);
556 CHECK (nl2 != ntd2); CHECK (ntd2 != nl2);
557 CHECK (nl2 != nts1); CHECK (nts1 != nl2);
558 CHECK (nl2 != nts2); CHECK (nts2 != nl2);
559 CHECK (nl2 != nh1 ); CHECK (nh1 != nl2);
560 CHECK (nl2 != nh2 ); CHECK (nh2 != nl2);
561 CHECK (nl2 != rec1); CHECK (rec1 != nl2);
562 CHECK (nl2 != rec2); CHECK (rec2 != nl2);
563 CHECK (nl2 != ref1); CHECK (ref1 != nl2);
564 CHECK (nl2 != ref2); CHECK (ref2 != nl2);
566 CHECK (nr1 != nr2); CHECK (nr2 != nr1);
567 CHECK (nr1 != nd1); CHECK (nd1 != nr1);
568 CHECK (nr1 != nd2); CHECK (nd2 != nr1);
569 CHECK (nr1 != nc1); CHECK (nc1 != nr1);
570 CHECK (nr1 != nc2); CHECK (nc2 != nr1);
571 CHECK (nr1 != nb1); CHECK (nb1 != nr1);
572 CHECK (nr1 != nb2); CHECK (nb2 != nr1);
573 CHECK (nr1 != ns1); CHECK (ns1 != nr1);
574 CHECK (nr1 != ns2); CHECK (ns2 != nr1);
575 CHECK (nr1 != nt1 ); CHECK (nt1 != nr1);
576 CHECK (nr1 != nt2 ); CHECK (nt2 != nr1);
577 CHECK (nr1 != nto1); CHECK (nto1 != nr1);
578 CHECK (nr1 != nto2); CHECK (nto2 != nr1);
579 CHECK (nr1 != ntd1); CHECK (ntd1 != nr1);
580 CHECK (nr1 != ntd2); CHECK (ntd2 != nr1);
581 CHECK (nr1 != nts1); CHECK (nts1 != nr1);
582 CHECK (nr1 != nts2); CHECK (nts2 != nr1);
583 CHECK (nr1 != nh1 ); CHECK (nh1 != nr1);
584 CHECK (nr1 != nh2 ); CHECK (nh2 != nr1);
585 CHECK (nr1 != rec1); CHECK (rec1 != nr1);
586 CHECK (nr1 != rec2); CHECK (rec2 != nr1);
587 CHECK (nr1 != ref1); CHECK (ref1 != nr1);
588 CHECK (nr1 != ref2); CHECK (ref2 != nr1);
590 CHECK (nr2 != nd1); CHECK (nd1 != nr2);
591 CHECK (nr2 != nd2); CHECK (nd2 != nr2);
592 CHECK (nr2 != nc1); CHECK (nc1 != nr2);
593 CHECK (nr2 != nc2); CHECK (nc2 != nr2);
594 CHECK (nr2 != nb1); CHECK (nb1 != nr2);
595 CHECK (nr2 != nb2); CHECK (nb2 != nr2);
596 CHECK (nr2 != ns1); CHECK (ns1 != nr2);
597 CHECK (nr2 != ns2); CHECK (ns2 != nr2);
598 CHECK (nr2 != nt1 ); CHECK (nt1 != nr2);
599 CHECK (nr2 != nt2 ); CHECK (nt2 != nr2);
600 CHECK (nr2 != nto1); CHECK (nto1 != nr2);
601 CHECK (nr2 != nto2); CHECK (nto2 != nr2);
602 CHECK (nr2 != ntd1); CHECK (ntd1 != nr2);
603 CHECK (nr2 != ntd2); CHECK (ntd2 != nr2);
604 CHECK (nr2 != nts1); CHECK (nts1 != nr2);
605 CHECK (nr2 != nts2); CHECK (nts2 != nr2);
606 CHECK (nr2 != nh1 ); CHECK (nh1 != nr2);
607 CHECK (nr2 != nh2 ); CHECK (nh2 != nr2);
608 CHECK (nr2 != rec1); CHECK (rec1 != nr2);
609 CHECK (nr2 != rec2); CHECK (rec2 != nr2);
610 CHECK (nr2 != ref1); CHECK (ref1 != nr2);
611 CHECK (nr2 != ref2); CHECK (ref2 != nr2);
613 CHECK (nd1 != nd2); CHECK (nd2 != nd1);
614 CHECK (nd1 != nc1); CHECK (nc1 != nd1);
615 CHECK (nd1 != nc2); CHECK (nc2 != nd1);
616 CHECK (nd1 != nb1); CHECK (nb1 != nd1);
617 CHECK (nd1 != nb2); CHECK (nb2 != nd1);
618 CHECK (nd1 != ns1); CHECK (ns1 != nd1);
619 CHECK (nd1 != ns2); CHECK (ns2 != nd1);
620 CHECK (nd1 != nt1 ); CHECK (nt1 != nd1);
621 CHECK (nd1 != nt2 ); CHECK (nt2 != nd1);
622 CHECK (nd1 != nto1); CHECK (nto1 != nd1);
623 CHECK (nd1 != nto2); CHECK (nto2 != nd1);
624 CHECK (nd1 != ntd1); CHECK (ntd1 != nd1);
625 CHECK (nd1 != ntd2); CHECK (ntd2 != nd1);
626 CHECK (nd1 != nts1); CHECK (nts1 != nd1);
627 CHECK (nd1 != nts2); CHECK (nts2 != nd1);
628 CHECK (nd1 != nh1 ); CHECK (nh1 != nd1);
629 CHECK (nd1 != nh2 ); CHECK (nh2 != nd1);
630 CHECK (nd1 != rec1); CHECK (rec1 != nd1);
631 CHECK (nd1 != rec2); CHECK (rec2 != nd1);
632 CHECK (nd1 != ref1); CHECK (ref1 != nd1);
633 CHECK (nd1 != ref2); CHECK (ref2 != nd1);
635 CHECK (nd2 != nc1); CHECK (nc1 != nd2);
636 CHECK (nd2 != nc2); CHECK (nc2 != nd2);
637 CHECK (nd2 != nb1); CHECK (nb1 != nd2);
638 CHECK (nd2 != nb2); CHECK (nb2 != nd2);
639 CHECK (nd2 != ns1); CHECK (ns1 != nd2);
640 CHECK (nd2 != ns2); CHECK (ns2 != nd2);
641 CHECK (nd2 != nt1 ); CHECK (nt1 != nd2);
642 CHECK (nd2 != nt2 ); CHECK (nt2 != nd2);
643 CHECK (nd2 != nto1); CHECK (nto1 != nd2);
644 CHECK (nd2 != nto2); CHECK (nto2 != nd2);
645 CHECK (nd2 != ntd1); CHECK (ntd1 != nd2);
646 CHECK (nd2 != ntd2); CHECK (ntd2 != nd2);
647 CHECK (nd2 != nts1); CHECK (nts1 != nd2);
648 CHECK (nd2 != nts2); CHECK (nts2 != nd2);
649 CHECK (nd2 != nh1 ); CHECK (nh1 != nd2);
650 CHECK (nd2 != nh2 ); CHECK (nh2 != nd2);
651 CHECK (nd2 != rec1); CHECK (rec1 != nd2);
652 CHECK (nd2 != rec2); CHECK (rec2 != nd2);
653 CHECK (nd2 != ref1); CHECK (ref1 != nd2);
654 CHECK (nd2 != ref2); CHECK (ref2 != nd2);
656 CHECK (nc1 != nc2); CHECK (nc2 != nc1);
657 CHECK (nc1 != nb1); CHECK (nb1 != nc1);
658 CHECK (nc1 != nb2); CHECK (nb2 != nc1);
659 CHECK (nc1 != ns1); CHECK (ns1 != nc1);
660 CHECK (nc1 != ns2); CHECK (ns2 != nc1);
661 CHECK (nc1 != nt1 ); CHECK (nt1 != nc1);
662 CHECK (nc1 != nt2 ); CHECK (nt2 != nc1);
663 CHECK (nc1 != nto1); CHECK (nto1 != nc1);
664 CHECK (nc1 != nto2); CHECK (nto2 != nc1);
665 CHECK (nc1 != ntd1); CHECK (ntd1 != nc1);
666 CHECK (nc1 != ntd2); CHECK (ntd2 != nc1);
667 CHECK (nc1 != nts1); CHECK (nts1 != nc1);
668 CHECK (nc1 != nts2); CHECK (nts2 != nc1);
669 CHECK (nc1 != nh1 ); CHECK (nh1 != nc1);
670 CHECK (nc1 != nh2 ); CHECK (nh2 != nc1);
671 CHECK (nc1 != rec1); CHECK (rec1 != nc1);
672 CHECK (nc1 != rec2); CHECK (rec2 != nc1);
673 CHECK (nc1 != ref1); CHECK (ref1 != nc1);
674 CHECK (nc1 != ref2); CHECK (ref2 != nc1);
676 CHECK (nc2 != nb1); CHECK (nb1 != nc2);
677 CHECK (nc2 != nb2); CHECK (nb2 != nc2);
678 CHECK (nc2 != ns1); CHECK (ns1 != nc2);
679 CHECK (nc2 != ns2); CHECK (ns2 != nc2);
680 CHECK (nc2 != nt1 ); CHECK (nt1 != nc2);
681 CHECK (nc2 != nt2 ); CHECK (nt2 != nc2);
682 CHECK (nc2 != nto1); CHECK (nto1 != nc2);
683 CHECK (nc2 != nto2); CHECK (nto2 != nc2);
684 CHECK (nc2 != ntd1); CHECK (ntd1 != nc2);
685 CHECK (nc2 != ntd2); CHECK (ntd2 != nc2);
686 CHECK (nc2 != nts1); CHECK (nts1 != nc2);
687 CHECK (nc2 != nts2); CHECK (nts2 != nc2);
688 CHECK (nc2 != nh1 ); CHECK (nh1 != nc2);
689 CHECK (nc2 != nh2 ); CHECK (nh2 != nc2);
690 CHECK (nc2 != rec1); CHECK (rec1 != nc2);
691 CHECK (nc2 != rec2); CHECK (rec2 != nc2);
692 CHECK (nc2 != ref1); CHECK (ref1 != nc2);
693 CHECK (nc2 != ref2); CHECK (ref2 != nc2);
695 CHECK (nb1 != nb2); CHECK (nb2 != nb1);
696 CHECK (nb1 != ns1); CHECK (ns1 != nb1);
697 CHECK (nb1 != ns2); CHECK (ns2 != nb1);
698 CHECK (nb1 != nt1 ); CHECK (nt1 != nb1);
699 CHECK (nb1 != nt2 ); CHECK (nt2 != nb1);
700 CHECK (nb1 != nto1); CHECK (nto1 != nb1);
701 CHECK (nb1 != nto2); CHECK (nto2 != nb1);
702 CHECK (nb1 != ntd1); CHECK (ntd1 != nb1);
703 CHECK (nb1 != ntd2); CHECK (ntd2 != nb1);
704 CHECK (nb1 != nts1); CHECK (nts1 != nb1);
705 CHECK (nb1 != nts2); CHECK (nts2 != nb1);
706 CHECK (nb1 != nh1 ); CHECK (nh1 != nb1);
707 CHECK (nb1 != nh2 ); CHECK (nh2 != nb1);
708 CHECK (nb1 != rec1); CHECK (rec1 != nb1);
709 CHECK (nb1 != rec2); CHECK (rec2 != nb1);
710 CHECK (nb1 != ref1); CHECK (ref1 != nb1);
711 CHECK (nb1 != ref2); CHECK (ref2 != nb1);
713 CHECK (nb2 != ns1); CHECK (ns1 != nb2);
714 CHECK (nb2 != ns2); CHECK (ns2 != nb2);
715 CHECK (nb2 != nt1 ); CHECK (nt1 != nb2);
716 CHECK (nb2 != nt2 ); CHECK (nt2 != nb2);
717 CHECK (nb2 != nto1); CHECK (nto1 != nb2);
718 CHECK (nb2 != nto2); CHECK (nto2 != nb2);
719 CHECK (nb2 != ntd1); CHECK (ntd1 != nb2);
720 CHECK (nb2 != ntd2); CHECK (ntd2 != nb2);
721 CHECK (nb2 != nts1); CHECK (nts1 != nb2);
722 CHECK (nb2 != nts2); CHECK (nts2 != nb2);
723 CHECK (nb2 != nh1 ); CHECK (nh1 != nb2);
724 CHECK (nb2 != nh2 ); CHECK (nh2 != nb2);
725 CHECK (nb2 != rec1); CHECK (rec1 != nb2);
726 CHECK (nb2 != rec2); CHECK (rec2 != nb2);
727 CHECK (nb2 != ref1); CHECK (ref1 != nb2);
728 CHECK (nb2 != ref2); CHECK (ref2 != nb2);
730 CHECK (ns1 != nt2 ); CHECK (nt2 != ns1);
731 CHECK (ns1 != nto1); CHECK (nto1 != ns1);
732 CHECK (ns1 != nto2); CHECK (nto2 != ns1);
733 CHECK (ns1 != ntd1); CHECK (ntd1 != ns1);
734 CHECK (ns1 != ntd2); CHECK (ntd2 != ns1);
735 CHECK (ns1 != nts1); CHECK (nts1 != ns1);
736 CHECK (ns1 != nts2); CHECK (nts2 != ns1);
737 CHECK (ns1 != nh1 ); CHECK (nh1 != ns1);
738 CHECK (ns1 != nh2 ); CHECK (nh2 != ns1);
739 CHECK (ns1 != rec1); CHECK (rec1 != ns1);
740 CHECK (ns1 != rec2); CHECK (rec2 != ns1);
741 CHECK (ns1 != ref1); CHECK (ref1 != ns1);
742 CHECK (ns1 != ref2); CHECK (ref2 != ns1);
744 CHECK (ns2 != nt1 ); CHECK (nt1 != ns2);
745 CHECK (ns2 != nt2 ); CHECK (nt2 != ns2);
746 CHECK (ns2 != nto1); CHECK (nto1 != ns2);
747 CHECK (ns2 != nto2); CHECK (nto2 != ns2);
748 CHECK (ns2 != ntd1); CHECK (ntd1 != ns2);
749 CHECK (ns2 != ntd2); CHECK (ntd2 != ns2);
750 CHECK (ns2 != nts1); CHECK (nts1 != ns2);
751 CHECK (ns2 != nts2); CHECK (nts2 != ns2);
752 CHECK (ns2 != nh1 ); CHECK (nh1 != ns2);
753 CHECK (ns2 != nh2 ); CHECK (nh2 != ns2);
754 CHECK (ns2 != rec1); CHECK (rec1 != ns2);
755 CHECK (ns2 != rec2); CHECK (rec2 != ns2);
756 CHECK (ns2 != ref1); CHECK (ref1 != ns2);
757 CHECK (ns2 != ref2); CHECK (ref2 != ns2);
759 CHECK (nt1 != nt2 ); CHECK (nt2 != nt1);
760 CHECK (nt1 != nto1); CHECK (nto1 != nt1);
761 CHECK (nt1 != nto2); CHECK (nto2 != nt1);
762 CHECK (nt1 != ntd1); CHECK (ntd1 != nt1);
763 CHECK (nt1 != ntd2); CHECK (ntd2 != nt1);
764 CHECK (nt1 != nts1); CHECK (nts1 != nt1);
765 CHECK (nt1 != nts2); CHECK (nts2 != nt1);
766 CHECK (nt1 != nh1 ); CHECK (nh1 != nt1);
767 CHECK (nt1 != nh2 ); CHECK (nh2 != nt1);
768 CHECK (nt1 != rec1); CHECK (rec1 != nt1);
769 CHECK (nt1 != rec2); CHECK (rec2 != nt1);
770 CHECK (nt1 != ref1); CHECK (ref1 != nt1);
771 CHECK (nt1 != ref2); CHECK (ref2 != nt1);
773 CHECK (nt2 != nto1); CHECK (nto1 != nt2);
774 CHECK (nt2 != nto2); CHECK (nto2 != nt2);
775 CHECK (nt2 != ntd1); CHECK (ntd1 != nt2);
776 CHECK (nt2 != ntd2); CHECK (ntd2 != nt2);
777 CHECK (nt2 != nts1); CHECK (nts1 != nt2);
778 CHECK (nt2 != nts2); CHECK (nts2 != nt2);
779 CHECK (nt2 != nh1 ); CHECK (nh1 != nt2);
780 CHECK (nt2 != nh2 ); CHECK (nh2 != nt2);
781 CHECK (nt2 != rec1); CHECK (rec1 != nt2);
782 CHECK (nt2 != rec2); CHECK (rec2 != nt2);
783 CHECK (nt2 != ref1); CHECK (ref1 != nt2);
784 CHECK (nt2 != ref2); CHECK (ref2 != nt2);
786 CHECK (nto1 != nto2); CHECK (nto2 != nto1);
787 CHECK (nto1 != ntd1); CHECK (ntd1 != nto1);
788 CHECK (nto1 != ntd2); CHECK (ntd2 != nto1);
789 CHECK (nto1 != nts1); CHECK (nts1 != nto1);
790 CHECK (nto1 != nts2); CHECK (nts2 != nto1);
791 CHECK (nto1 != nh1 ); CHECK (nh1 != nto1);
792 CHECK (nto1 != nh2 ); CHECK (nh2 != nto1);
793 CHECK (nto1 != rec1); CHECK (rec1 != nto1);
794 CHECK (nto1 != rec2); CHECK (rec2 != nto1);
795 CHECK (nto1 != ref1); CHECK (ref1 != nto1);
796 CHECK (nto1 != ref2); CHECK (ref2 != nto1);
798 CHECK (nto2 != ntd1); CHECK (ntd1 != nto2);
799 CHECK (nto2 != ntd2); CHECK (ntd2 != nto2);
800 CHECK (nto2 != nts1); CHECK (nts1 != nto2);
801 CHECK (nto2 != nts2); CHECK (nts2 != nto2);
802 CHECK (nto2 != nh1 ); CHECK (nh1 != nto2);
803 CHECK (nto2 != nh2 ); CHECK (nh2 != nto2);
804 CHECK (nto2 != rec1); CHECK (rec1 != nto2);
805 CHECK (nto2 != rec2); CHECK (rec2 != nto2);
806 CHECK (nto2 != ref1); CHECK (ref1 != nto2);
807 CHECK (nto2 != ref2); CHECK (ref2 != nto2);
809 CHECK (ntd1 != ntd2); CHECK (ntd2 != ntd1);
810 CHECK (ntd1 != nts1); CHECK (nts1 != ntd1);
811 CHECK (ntd1 != nts2); CHECK (nts2 != ntd1);
812 CHECK (ntd1 != nh1 ); CHECK (nh1 != ntd1);
813 CHECK (ntd1 != nh2 ); CHECK (nh2 != ntd1);
814 CHECK (ntd1 != rec1); CHECK (rec1 != ntd1);
815 CHECK (ntd1 != rec2); CHECK (rec2 != ntd1);
816 CHECK (ntd1 != ref1); CHECK (ref1 != ntd1);
817 CHECK (ntd1 != ref2); CHECK (ref2 != ntd1);
819 CHECK (ntd2 != nts1); CHECK (nts1 != ntd2);
820 CHECK (ntd2 != nts2); CHECK (nts2 != ntd2);
821 CHECK (ntd2 != nh1 ); CHECK (nh1 != ntd2);
822 CHECK (ntd2 != nh2 ); CHECK (nh2 != ntd2);
823 CHECK (ntd2 != rec1); CHECK (rec1 != ntd2);
824 CHECK (ntd2 != rec2); CHECK (rec2 != ntd2);
825 CHECK (ntd2 != ref1); CHECK (ref1 != ntd2);
826 CHECK (ntd2 != ref2); CHECK (ref2 != ntd2);
828 CHECK (nts1 != nts2); CHECK (nts2 != nts1);
829 CHECK (nts1 != nh1 ); CHECK (nh1 != nts1);
830 CHECK (nts1 != nh2 ); CHECK (nh2 != nts1);
831 CHECK (nts1 != rec1); CHECK (rec1 != nts1);
832 CHECK (nts1 != rec2); CHECK (rec2 != nts1);
833 CHECK (nts1 != ref1); CHECK (ref1 != nts1);
834 CHECK (nts1 != ref2); CHECK (ref2 != nts1);
836 CHECK (nts2 != nh1 ); CHECK (nh1 != nts2);
837 CHECK (nts2 != nh2 ); CHECK (nh2 != nts2);
838 CHECK (nts2 != rec1); CHECK (rec1 != nts2);
839 CHECK (nts2 != rec2); CHECK (rec2 != nts2);
840 CHECK (nts2 != ref1); CHECK (ref1 != nts2);
841 CHECK (nts2 != ref2); CHECK (ref2 != nts2);
843 CHECK (nh1 != nh2 ); CHECK (nh2 != nh1);
844 CHECK (nh1 != rec1); CHECK (rec1 != nh1);
845 CHECK (nh1 != rec2); CHECK (rec2 != nh1);
846 CHECK (nh1 != ref1); CHECK (ref1 != nh1);
847 CHECK (nh1 != ref2); CHECK (ref2 != nh1);
849 CHECK (nh2 != rec1); CHECK (rec1 != nh2);
850 CHECK (nh2 != rec2); CHECK (rec2 != nh2);
851 CHECK (nh2 != ref1); CHECK (ref1 != nh2);
852 CHECK (nh2 != ref2); CHECK (ref2 != nh2);
854 CHECK (rec1 != rec2); CHECK (rec2 != rec1);
855 CHECK (ref1 != ref2); CHECK (ref2 != ref1);
858 CHECK (rec1 == ref1); CHECK (ref1 == rec1);
859 CHECK (rec1 != ref2); CHECK (ref2 != rec1);
861 CHECK (rec2 != ref1); CHECK (ref1 != rec2);
862 CHECK (rec2 == ref2); CHECK (ref2 == rec2);
869 CHECK (ni1 .matches(ni1 )); CHECK (ni1 .matches(ni1 .idi)); CHECK (ni1 .matches(i1 ));
870 CHECK (ni2 .matches(ni2 )); CHECK (ni2 .matches(ni2 .idi)); CHECK (ni2 .matches(i2 ));
871 CHECK (nl1 .matches(nl1 )); CHECK (nl1 .matches(nl1 .idi)); CHECK (nl1 .matches(l1 ));
872 CHECK (nl2 .matches(nl2 )); CHECK (nl2 .matches(nl2 .idi)); CHECK (nl2 .matches(l2 ));
873 CHECK (nr1 .matches(nr1 )); CHECK (nr1 .matches(nr1 .idi)); CHECK (nr1 .matches(r1 ));
874 CHECK (nr2 .matches(nr2 )); CHECK (nr2 .matches(nr2 .idi)); CHECK (nr2 .matches(r2 ));
875 CHECK (nd1 .matches(nd1 )); CHECK (nd1 .matches(nd1 .idi)); CHECK (nd1 .matches(d1 ));
876 CHECK (nd2 .matches(nd2 )); CHECK (nd2 .matches(nd2 .idi)); CHECK (nd2 .matches(d2 ));
877 CHECK (nc1 .matches(nc1 )); CHECK (nc1 .matches(nc1 .idi)); CHECK (nc1 .matches(c1 ));
878 CHECK (nc2 .matches(nc2 )); CHECK (nc2 .matches(nc2 .idi)); CHECK (nc2 .matches(c2 ));
879 CHECK (nb1 .matches(nb1 )); CHECK (nb1 .matches(nb1 .idi)); CHECK (nb1 .matches(b1 ));
880 CHECK (nb2 .matches(nb2 )); CHECK (nb2 .matches(nb2 .idi)); CHECK (nb2 .matches(b2 ));
881 CHECK (ns1 .matches(ns1 )); CHECK (ns1 .matches(ns1 .idi)); CHECK (ns1 .matches(s1 ));
882 CHECK (ns2 .matches(ns2 )); CHECK (ns2 .matches(ns2 .idi)); CHECK (ns2 .matches(s2 ));
883 CHECK (nt1 .matches(nt1 )); CHECK (nt1 .matches(nt1 .idi)); CHECK (nt1 .matches(t1 ));
884 CHECK (nt2 .matches(nt2 )); CHECK (nt2 .matches(nt2 .idi)); CHECK (nt2 .matches(t2 ));
891 CHECK (nh1 .matches(nh1 )); CHECK (nh1 .matches(nh1 .idi)); CHECK (nh1 .matches(h1 ));
892 CHECK (nh2 .matches(nh2 )); CHECK (nh2 .matches(nh2 .idi)); CHECK (nh2 .matches(h2 ));
893 CHECK (rec1.matches(rec1)); CHECK (rec1.matches(rec1.idi)); CHECK (rec1.matches(spam1));
925 CHECK (rec1.matches(ref1.idi));
926 CHECK (ref1.
matches(rec1.idi));
927 CHECK (rec2.
matches(ref2.idi));
928 CHECK (ref2.
matches(rec2.idi));
952 CHECK (copy.idi == ni1.idi);
953 CHECK (not copy.data.matchData(ni1.data));
956 CHECK (copy.matches(ni1)); CHECK (ni1.
matches(copy));
973 CHECK (not n1.isNamed());
974 CHECK ( n2.isNamed());
975 CHECK (not n3.isNamed());
977 CHECK (not n1.isNested());
978 CHECK ( n2.isNested());
979 CHECK ( n3.isNested());
981 CHECK (n1.data.
recordType() == util::BOTTOM_INDICATOR);
983 CHECK (n3.data.
recordType() == Rec::TYPE_NIL );
985 CHECK (not n1.hasAttribute(
"baked beans"));
986 CHECK (not n2.hasAttribute(
"baked beans"));
987 CHECK (not n3.hasAttribute(
"baked beans"));
989 CHECK (not n1.hasAttribute(
"Ψ"));
990 CHECK (not n2.hasAttribute(
"Ψ"));
991 CHECK ( n3.hasAttribute(
"Ψ"));
1004 CHECK (not n1.hasChildren());
1005 CHECK (not n2.hasChildren());
1006 CHECK (not n3.hasChildren());
Constructor for a specially crafted 'ref GenNode'.
void convenienceRecAccess()
typed symbolic and hash ID for asset-like position accounting.
static const Ref CHILD
symbolic ID ref "_CHILD_"
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
string renderCompact(Rec const &rec)
compact textual representation of a Record<GenNode> (»object«).
Implementation namespace for support and library code.
Lumiera's internal time value datatype.
Special collection to represent object-like data.
static const Ref END
symbolic ID ref "_END_"
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
wrapped record reference.
Utilities for quantisation (grid alignment) and comparisons.
Generic building block for tree shaped (meta)data structures.
boost::rational< int64_t > FSecs
rational representation of fractional seconds
A collection of frequently used helper functions to support unit testing.
std::optional< X > retrieveAttribute(string key) const
mismatch tolerant convenience shortcut to peek into the attributes of a nested Record ...
Hash implementation based on a lumiera unique object id (LUID) When invoking the default ctor...
bool matches(GenNode const &o) const
static const Ref ATTRIBS
symbolic ID ref "_ATTRIBS_"
Offset measures a distance in time.
string recordType() const
peek into the type field of a nested Record<GenNode>
Duration is the internal Lumiera time metric.
lib::time::Time randTime()
create a random but not insane Time value between 1s ...
bool almostEqual(double d1, double d2, unsigned int ulp=2)
epsilon comparison of doubles.
A time interval anchored at a specific point in time.
a family of time value like entities and their relationships.
object-like record of data.
static const Ref THIS
symbolic ID ref "_THIS_"
generic data element node within a tree
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.