46 using LERR_(WRONG_TYPE);
47 using LERR_(BOTTOM_VALUE);
51 const double PI = 3.14159265358979323846264338328;
102 CHECK (42 == n1.data.get<
int>());
103 CHECK (!n1.isNamed());
104 CHECK (contains (n1.idi.getSym(),
"_CHILD_"));
105 CHECK (contains (
name(n1),
"_CHILD_"));
109 CHECK (almostEqual (PI, n2.data.get<
double>()));
110 CHECK (n2.isNamed());
111 CHECK (
"π" == n2.idi.getSym());
112 CHECK (
"π" ==
name(n2));
117 CHECK (42 == n11.data.get<
int>());
122 CHECK (24 == n11.data.get<
int>());
123 CHECK (42 == n1.data.get<
int>());
134 CHECK (
"spam" == n3.data.get<
Rec>().getType());
135 CHECK (
"eggs" == n3.data.get<
Rec>().get(
"ham").data.get<
string>());
136 CHECK (
"ham" == n3.data.get<
Rec>().get(
"ham").idi.getSym());
137 CHECK (n3.data.get<
Rec>().get(
"ham").isNamed());
138 CHECK (!n3.isNamed());
150 auto o1 =
MakeRec().genNode(
"νόμος");
151 auto o2 =
MakeRec().type(
"spam").genNode();
152 auto o3 =
MakeRec().attrib(
"Ψ", int64_t(42),
"π", 3.14159265358979323846264338328).genNode(
"μάθησις");
154 CHECK (!o0.isNamed());
155 CHECK (isnil(o0.data.get<
Rec>()));
156 CHECK (
"NIL" == o0.data.get<
Rec>().getType());
158 CHECK (o1.isNamed());
159 CHECK (
"νόμος" == o1.idi.getSym());
160 CHECK (isnil(o1.data.get<
Rec>()));
162 CHECK (!o2.isNamed());
163 CHECK (
"spam" == o2.data.get<
Rec>().getType());
164 CHECK (isnil(o2.data.get<
Rec>()));
166 CHECK (o3.isNamed());
167 CHECK (
"μάθησις" == o3.idi.getSym());
168 CHECK (
"NIL" == o3.data.get<
Rec>().getType());
169 CHECK (
GenNode(
"Ψ", int64_t(42)) == o3.data.get<
Rec>().get(
"Ψ"));
170 CHECK (42L == o3.data.get<
Rec>().get(
"Ψ").data.get<int64_t>());
171 CHECK (almostEqual (PI, o3.data.get<
Rec>().get(
"π").data.get<
double>()));
181 ,
MakeRec().type(
"ham").scope(
"eggs").genNode())
182 .genNode(
"baked beans");
184 CHECK (o4.isNamed());
185 CHECK (
"baked beans" == o4.idi.getSym());
186 CHECK (
"spam" == o4.data.get<
Rec>().getType());
188 auto scope = o4.data.get<
Rec>().scope();
189 CHECK (!isnil(scope));
192 CHECK (
char(
'*') == scope->data.get<
char>());
194 CHECK (
"★" == scope->data.get<
string>());
196 CHECK (luid == scope->data.get<
LuidH>());
198 CHECK (
Time(920,0) == scope->data.get<
TimeSpan>().end());
202 CHECK (
"ham" == spam.data.get<
Rec>().getType());
203 CHECK (spam.contains (
"eggs"));
207 CHECK (isnil(o2.data.get<
Rec>()));
211 auto o5 =
MakeRec().genNode(veryspecialID);
212 CHECK (o5 !=
MakeRec().genNode());
213 CHECK (o5 !=
MakeRec().genNode(
"quasi niente"));
214 CHECK (o5 ==
MakeRec().genNode(veryspecialID));
215 CHECK (
name(o5) ==
"quasi_niente");
216 CHECK (o5.idi == veryspecialID);
224 GenNode ham =
MakeRec().type(
"spam").attrib(
"τ",
Time(23,42)).genNode(
"egg bacon sausage and spam");
227 CHECK (hamID == ham.idi);
228 CHECK (hamID.getSym() == ham.idi.getSym());
229 CHECK (hamID.getHash() == ham.idi.getHash());
230 CHECK (contains (
string(hamID),
"spam"));
232 Ref ref1(
"egg bacon sausage and spam");
235 CHECK (ref1.idi == ham.idi);
236 CHECK (ref2.idi == ham.idi);
239 Rec& hamRef = ham.data.get<
Rec>();
240 CHECK (isSameObject (hamRef, ref2.data.get<
Rec>()));
249 CHECK (isSameObject(hamRef, ham_ref));
250 CHECK (isSameObject(hamRef, *rr2.get()));
273 .scope(
"eggs",
"spam",
"spam")
277 .attrib(
"hasSpam",
true)
278 .genNode(
"baked beans");
281 cout <<
"--spam--"<<endl;
285 CHECK (
renderCompact(n) ==
"{hasSpam=true|*, ★, 3.1415927, ham{|eggs, spam, spam}, 0:00:00.000≺920ms≻, 42}"_expect);
288 auto iter = n.begin();
289 CHECK (!isnil (
iter));
290 CHECK (1 ==
iter.level());
291 CHECK (
"baked beans" ==
iter->idi.getSym());
292 CHECK (Rec::TYPE_NIL ==
iter->data.get<
Rec>().getType());
295 CHECK (2 == iter.level());
296 CHECK (
"hasSpam" == iter->idi.getSym());
297 CHECK (
true == iter->data.get<
bool>());
298 CHECK (
"GenNode-ID(\"hasSpam\")-DataCap|«bool»|true" ==
string(*iter));
301 CHECK (!iter->isNamed());
302 CHECK (
'*' == iter->data.get<
char>());
305 CHECK (!iter->isNamed());
306 CHECK (
"★" == iter->data.get<
string>());
309 CHECK (!iter->isNamed());
310 CHECK (almostEqual (PI, iter->data.get<
double>()));
313 CHECK (
"spam" == iter->idi.getSym());
314 CHECK (
"ham" == iter->data.get<
Rec>().getType());
317 CHECK (3 == iter.level());
318 CHECK (
"eggs" == iter->data.get<
string>());
321 CHECK (
"spam" == iter->data.get<
string>());
324 CHECK (
"spam" == iter->data.get<
string>());
325 CHECK (3 == iter.level());
328 CHECK (2 == iter.level());
329 CHECK (!iter->isNamed());
330 CHECK (
"0:00:00.000≺920ms≻" ==
string(iter->data.get<
TimeSpan>()));
332 CHECK (!iter->isNamed());
333 CHECK (42 == iter->data.get<int64_t>());
334 CHECK (2 == iter.level());
337 CHECK (0 == iter.level());
338 CHECK (isnil (iter));
344 auto child = childData(n);
345 CHECK (!isnil (child));
346 CHECK (
'*' == child->get<
char>());
349 CHECK (
"★" == child->get<
string>());
352 CHECK (almostEqual (PI, child->get<
double>()));
355 CHECK (
"ham" == child->get<
Rec>().getType());
356 CHECK (
"eggs" == child->get<
Rec>().child(0).data.get<
string>());
362 CHECK (42 == child->get<int64_t>());
365 CHECK (isnil (child));
367 CHECK (n.hasChildren());
368 CHECK (not
GenNode{42}.hasChildren());
377 int64_t l1 = 64;
GenNode nl1(l1);
378 int64_t l2 = 126;
GenNode nl2(l2);
379 short r1 = 64;
GenNode nr1(r1);
380 short r2 = 126;
GenNode nr2(r2);
381 double d1 = 64;
GenNode nd1(d1);
382 double d2 = 126;
GenNode nd2(d2);
383 char c1 =
'@';
GenNode nc1(c1);
384 char c2 =
'~';
GenNode nc2(c2);
385 bool b1 =
true;
GenNode nb1(b1);
386 bool b2 =
false;
GenNode nb2(b2);
387 string s1 =
"";
GenNode ns1(s1);
388 string s2 =
"↯";
GenNode ns2(s2);
423 CHECK (nto1 == nto1);
424 CHECK (nto2 == nto2);
425 CHECK (ntd1 == ntd1);
426 CHECK (ntd2 == ntd2);
427 CHECK (nts1 == nts1);
428 CHECK (nts2 == nts2);
431 CHECK (rec1 == rec1);
432 CHECK (rec2 == rec2);
433 CHECK (ref1 == ref1);
434 CHECK (ref2 == ref2);
436 CHECK (ni1 != ni2); CHECK (ni2 != ni1);
437 CHECK (nl1 != nl2); CHECK (nl2 != nl1);
438 CHECK (nr1 != nr2); CHECK (nr2 != nr1);
439 CHECK (nd1 != nd2); CHECK (nd2 != nd1);
440 CHECK (nc1 != nc2); CHECK (nc2 != nc1);
441 CHECK (nb1 != nb2); CHECK (nb2 != nb1);
442 CHECK (ns1 != ns2); CHECK (ns2 != ns1);
443 CHECK (nt1 != nt2 ); CHECK (nt2 != nt1 );
444 CHECK (nto1 != nto2); CHECK (nto2 != nto1);
445 CHECK (ntd1 != ntd2); CHECK (ntd2 != ntd1);
446 CHECK (nts1 != nts2); CHECK (nts2 != nts1);
447 CHECK (nh1 != nh2 ); CHECK (nh2 != nh1 );
448 CHECK (rec1 != rec2); CHECK (rec2 != rec1);
449 CHECK (ref1 != ref2); CHECK (ref2 != ref1);
451 CHECK (ni1 != ni2); CHECK (ni2 != ni1);
452 CHECK (ni1 != nl1); CHECK (nl1 != ni1);
453 CHECK (ni1 != nl2); CHECK (nl2 != ni1);
454 CHECK (ni1 != nr1); CHECK (nr1 != ni1);
455 CHECK (ni1 != nr2); CHECK (nr2 != ni1);
456 CHECK (ni1 != nd1); CHECK (nd1 != ni1);
457 CHECK (ni1 != nd2); CHECK (nd2 != ni1);
458 CHECK (ni1 != nc1); CHECK (nc1 != ni1);
459 CHECK (ni1 != nc2); CHECK (nc2 != ni1);
460 CHECK (ni1 != nb1); CHECK (nb1 != ni1);
461 CHECK (ni1 != nb2); CHECK (nb2 != ni1);
462 CHECK (ni1 != ns1); CHECK (ns1 != ni1);
463 CHECK (ni1 != ns2); CHECK (ns2 != ni1);
464 CHECK (ni1 != nt1 ); CHECK (nt1 != ni1);
465 CHECK (ni1 != nt2 ); CHECK (nt2 != ni1);
466 CHECK (ni1 != nto1); CHECK (nto1 != ni1);
467 CHECK (ni1 != nto2); CHECK (nto2 != ni1);
468 CHECK (ni1 != ntd1); CHECK (ntd1 != ni1);
469 CHECK (ni1 != ntd2); CHECK (ntd2 != ni1);
470 CHECK (ni1 != nts1); CHECK (nts1 != ni1);
471 CHECK (ni1 != nts2); CHECK (nts2 != ni1);
472 CHECK (ni1 != nh1 ); CHECK (nh1 != ni1);
473 CHECK (ni1 != nh2 ); CHECK (nh2 != ni1);
474 CHECK (ni1 != rec1); CHECK (rec1 != ni1);
475 CHECK (ni1 != rec2); CHECK (rec2 != ni1);
476 CHECK (ni1 != ref1); CHECK (ref1 != ni1);
477 CHECK (ni1 != ref2); CHECK (ref2 != ni1);
479 CHECK (ni2 != nl1); CHECK (nl1 != ni2);
480 CHECK (ni2 != nl2); CHECK (nl2 != ni2);
481 CHECK (ni2 != nr1); CHECK (nr1 != ni2);
482 CHECK (ni2 != nr2); CHECK (nr2 != ni2);
483 CHECK (ni2 != nd1); CHECK (nd1 != ni2);
484 CHECK (ni2 != nd2); CHECK (nd2 != ni2);
485 CHECK (ni2 != nc1); CHECK (nc1 != ni2);
486 CHECK (ni2 != nc2); CHECK (nc2 != ni2);
487 CHECK (ni2 != nb1); CHECK (nb1 != ni2);
488 CHECK (ni2 != nb2); CHECK (nb2 != ni2);
489 CHECK (ni2 != ns1); CHECK (ns1 != ni2);
490 CHECK (ni2 != ns2); CHECK (ns2 != ni2);
491 CHECK (ni2 != nt1 ); CHECK (nt1 != ni2);
492 CHECK (ni2 != nt2 ); CHECK (nt2 != ni2);
493 CHECK (ni2 != nto1); CHECK (nto1 != ni2);
494 CHECK (ni2 != nto2); CHECK (nto2 != ni2);
495 CHECK (ni2 != ntd1); CHECK (ntd1 != ni2);
496 CHECK (ni2 != ntd2); CHECK (ntd2 != ni2);
497 CHECK (ni2 != nts1); CHECK (nts1 != ni2);
498 CHECK (ni2 != nts2); CHECK (nts2 != ni2);
499 CHECK (ni2 != nh1 ); CHECK (nh1 != ni2);
500 CHECK (ni2 != nh2 ); CHECK (nh2 != ni2);
501 CHECK (ni2 != rec1); CHECK (rec1 != ni2);
502 CHECK (ni2 != rec2); CHECK (rec2 != ni2);
503 CHECK (ni2 != ref1); CHECK (ref1 != ni2);
504 CHECK (ni2 != ref2); CHECK (ref2 != ni2);
506 CHECK (nl1 != nl2); CHECK (nl2 != nl1);
507 CHECK (nl1 != nr1); CHECK (nr1 != nl1);
508 CHECK (nl1 != nr2); CHECK (nr2 != nl1);
509 CHECK (nl1 != nd1); CHECK (nd1 != nl1);
510 CHECK (nl1 != nd2); CHECK (nd2 != nl1);
511 CHECK (nl1 != nc1); CHECK (nc1 != nl1);
512 CHECK (nl1 != nc2); CHECK (nc2 != nl1);
513 CHECK (nl1 != nb1); CHECK (nb1 != nl1);
514 CHECK (nl1 != nb2); CHECK (nb2 != nl1);
515 CHECK (nl1 != ns1); CHECK (ns1 != nl1);
516 CHECK (nl1 != ns2); CHECK (ns2 != nl1);
517 CHECK (nl1 != nt1 ); CHECK (nt1 != nl1);
518 CHECK (nl1 != nt2 ); CHECK (nt2 != nl1);
519 CHECK (nl1 != nto1); CHECK (nto1 != nl1);
520 CHECK (nl1 != nto2); CHECK (nto2 != nl1);
521 CHECK (nl1 != ntd1); CHECK (ntd1 != nl1);
522 CHECK (nl1 != ntd2); CHECK (ntd2 != nl1);
523 CHECK (nl1 != nts1); CHECK (nts1 != nl1);
524 CHECK (nl1 != nts2); CHECK (nts2 != nl1);
525 CHECK (nl1 != nh1 ); CHECK (nh1 != nl1);
526 CHECK (nl1 != nh2 ); CHECK (nh2 != nl1);
527 CHECK (nl1 != rec1); CHECK (rec1 != nl1);
528 CHECK (nl1 != rec2); CHECK (rec2 != nl1);
529 CHECK (nl1 != ref1); CHECK (ref1 != nl1);
530 CHECK (nl1 != ref2); CHECK (ref2 != nl1);
532 CHECK (nl2 != nr1); CHECK (nr1 != nl2);
533 CHECK (nl2 != nr2); CHECK (nr2 != nl2);
534 CHECK (nl2 != nd1); CHECK (nd1 != nl2);
535 CHECK (nl2 != nd2); CHECK (nd2 != nl2);
536 CHECK (nl2 != nc1); CHECK (nc1 != nl2);
537 CHECK (nl2 != nc2); CHECK (nc2 != nl2);
538 CHECK (nl2 != nb1); CHECK (nb1 != nl2);
539 CHECK (nl2 != nb2); CHECK (nb2 != nl2);
540 CHECK (nl2 != ns1); CHECK (ns1 != nl2);
541 CHECK (nl2 != ns2); CHECK (ns2 != nl2);
542 CHECK (nl2 != nt1 ); CHECK (nt1 != nl2);
543 CHECK (nl2 != nt2 ); CHECK (nt2 != nl2);
544 CHECK (nl2 != nto1); CHECK (nto1 != nl2);
545 CHECK (nl2 != nto2); CHECK (nto2 != nl2);
546 CHECK (nl2 != ntd1); CHECK (ntd1 != nl2);
547 CHECK (nl2 != ntd2); CHECK (ntd2 != nl2);
548 CHECK (nl2 != nts1); CHECK (nts1 != nl2);
549 CHECK (nl2 != nts2); CHECK (nts2 != nl2);
550 CHECK (nl2 != nh1 ); CHECK (nh1 != nl2);
551 CHECK (nl2 != nh2 ); CHECK (nh2 != nl2);
552 CHECK (nl2 != rec1); CHECK (rec1 != nl2);
553 CHECK (nl2 != rec2); CHECK (rec2 != nl2);
554 CHECK (nl2 != ref1); CHECK (ref1 != nl2);
555 CHECK (nl2 != ref2); CHECK (ref2 != nl2);
557 CHECK (nr1 != nr2); CHECK (nr2 != nr1);
558 CHECK (nr1 != nd1); CHECK (nd1 != nr1);
559 CHECK (nr1 != nd2); CHECK (nd2 != nr1);
560 CHECK (nr1 != nc1); CHECK (nc1 != nr1);
561 CHECK (nr1 != nc2); CHECK (nc2 != nr1);
562 CHECK (nr1 != nb1); CHECK (nb1 != nr1);
563 CHECK (nr1 != nb2); CHECK (nb2 != nr1);
564 CHECK (nr1 != ns1); CHECK (ns1 != nr1);
565 CHECK (nr1 != ns2); CHECK (ns2 != nr1);
566 CHECK (nr1 != nt1 ); CHECK (nt1 != nr1);
567 CHECK (nr1 != nt2 ); CHECK (nt2 != nr1);
568 CHECK (nr1 != nto1); CHECK (nto1 != nr1);
569 CHECK (nr1 != nto2); CHECK (nto2 != nr1);
570 CHECK (nr1 != ntd1); CHECK (ntd1 != nr1);
571 CHECK (nr1 != ntd2); CHECK (ntd2 != nr1);
572 CHECK (nr1 != nts1); CHECK (nts1 != nr1);
573 CHECK (nr1 != nts2); CHECK (nts2 != nr1);
574 CHECK (nr1 != nh1 ); CHECK (nh1 != nr1);
575 CHECK (nr1 != nh2 ); CHECK (nh2 != nr1);
576 CHECK (nr1 != rec1); CHECK (rec1 != nr1);
577 CHECK (nr1 != rec2); CHECK (rec2 != nr1);
578 CHECK (nr1 != ref1); CHECK (ref1 != nr1);
579 CHECK (nr1 != ref2); CHECK (ref2 != nr1);
581 CHECK (nr2 != nd1); CHECK (nd1 != nr2);
582 CHECK (nr2 != nd2); CHECK (nd2 != nr2);
583 CHECK (nr2 != nc1); CHECK (nc1 != nr2);
584 CHECK (nr2 != nc2); CHECK (nc2 != nr2);
585 CHECK (nr2 != nb1); CHECK (nb1 != nr2);
586 CHECK (nr2 != nb2); CHECK (nb2 != nr2);
587 CHECK (nr2 != ns1); CHECK (ns1 != nr2);
588 CHECK (nr2 != ns2); CHECK (ns2 != nr2);
589 CHECK (nr2 != nt1 ); CHECK (nt1 != nr2);
590 CHECK (nr2 != nt2 ); CHECK (nt2 != nr2);
591 CHECK (nr2 != nto1); CHECK (nto1 != nr2);
592 CHECK (nr2 != nto2); CHECK (nto2 != nr2);
593 CHECK (nr2 != ntd1); CHECK (ntd1 != nr2);
594 CHECK (nr2 != ntd2); CHECK (ntd2 != nr2);
595 CHECK (nr2 != nts1); CHECK (nts1 != nr2);
596 CHECK (nr2 != nts2); CHECK (nts2 != nr2);
597 CHECK (nr2 != nh1 ); CHECK (nh1 != nr2);
598 CHECK (nr2 != nh2 ); CHECK (nh2 != nr2);
599 CHECK (nr2 != rec1); CHECK (rec1 != nr2);
600 CHECK (nr2 != rec2); CHECK (rec2 != nr2);
601 CHECK (nr2 != ref1); CHECK (ref1 != nr2);
602 CHECK (nr2 != ref2); CHECK (ref2 != nr2);
604 CHECK (nd1 != nd2); CHECK (nd2 != nd1);
605 CHECK (nd1 != nc1); CHECK (nc1 != nd1);
606 CHECK (nd1 != nc2); CHECK (nc2 != nd1);
607 CHECK (nd1 != nb1); CHECK (nb1 != nd1);
608 CHECK (nd1 != nb2); CHECK (nb2 != nd1);
609 CHECK (nd1 != ns1); CHECK (ns1 != nd1);
610 CHECK (nd1 != ns2); CHECK (ns2 != nd1);
611 CHECK (nd1 != nt1 ); CHECK (nt1 != nd1);
612 CHECK (nd1 != nt2 ); CHECK (nt2 != nd1);
613 CHECK (nd1 != nto1); CHECK (nto1 != nd1);
614 CHECK (nd1 != nto2); CHECK (nto2 != nd1);
615 CHECK (nd1 != ntd1); CHECK (ntd1 != nd1);
616 CHECK (nd1 != ntd2); CHECK (ntd2 != nd1);
617 CHECK (nd1 != nts1); CHECK (nts1 != nd1);
618 CHECK (nd1 != nts2); CHECK (nts2 != nd1);
619 CHECK (nd1 != nh1 ); CHECK (nh1 != nd1);
620 CHECK (nd1 != nh2 ); CHECK (nh2 != nd1);
621 CHECK (nd1 != rec1); CHECK (rec1 != nd1);
622 CHECK (nd1 != rec2); CHECK (rec2 != nd1);
623 CHECK (nd1 != ref1); CHECK (ref1 != nd1);
624 CHECK (nd1 != ref2); CHECK (ref2 != nd1);
626 CHECK (nd2 != nc1); CHECK (nc1 != nd2);
627 CHECK (nd2 != nc2); CHECK (nc2 != nd2);
628 CHECK (nd2 != nb1); CHECK (nb1 != nd2);
629 CHECK (nd2 != nb2); CHECK (nb2 != nd2);
630 CHECK (nd2 != ns1); CHECK (ns1 != nd2);
631 CHECK (nd2 != ns2); CHECK (ns2 != nd2);
632 CHECK (nd2 != nt1 ); CHECK (nt1 != nd2);
633 CHECK (nd2 != nt2 ); CHECK (nt2 != nd2);
634 CHECK (nd2 != nto1); CHECK (nto1 != nd2);
635 CHECK (nd2 != nto2); CHECK (nto2 != nd2);
636 CHECK (nd2 != ntd1); CHECK (ntd1 != nd2);
637 CHECK (nd2 != ntd2); CHECK (ntd2 != nd2);
638 CHECK (nd2 != nts1); CHECK (nts1 != nd2);
639 CHECK (nd2 != nts2); CHECK (nts2 != nd2);
640 CHECK (nd2 != nh1 ); CHECK (nh1 != nd2);
641 CHECK (nd2 != nh2 ); CHECK (nh2 != nd2);
642 CHECK (nd2 != rec1); CHECK (rec1 != nd2);
643 CHECK (nd2 != rec2); CHECK (rec2 != nd2);
644 CHECK (nd2 != ref1); CHECK (ref1 != nd2);
645 CHECK (nd2 != ref2); CHECK (ref2 != nd2);
647 CHECK (nc1 != nc2); CHECK (nc2 != nc1);
648 CHECK (nc1 != nb1); CHECK (nb1 != nc1);
649 CHECK (nc1 != nb2); CHECK (nb2 != nc1);
650 CHECK (nc1 != ns1); CHECK (ns1 != nc1);
651 CHECK (nc1 != ns2); CHECK (ns2 != nc1);
652 CHECK (nc1 != nt1 ); CHECK (nt1 != nc1);
653 CHECK (nc1 != nt2 ); CHECK (nt2 != nc1);
654 CHECK (nc1 != nto1); CHECK (nto1 != nc1);
655 CHECK (nc1 != nto2); CHECK (nto2 != nc1);
656 CHECK (nc1 != ntd1); CHECK (ntd1 != nc1);
657 CHECK (nc1 != ntd2); CHECK (ntd2 != nc1);
658 CHECK (nc1 != nts1); CHECK (nts1 != nc1);
659 CHECK (nc1 != nts2); CHECK (nts2 != nc1);
660 CHECK (nc1 != nh1 ); CHECK (nh1 != nc1);
661 CHECK (nc1 != nh2 ); CHECK (nh2 != nc1);
662 CHECK (nc1 != rec1); CHECK (rec1 != nc1);
663 CHECK (nc1 != rec2); CHECK (rec2 != nc1);
664 CHECK (nc1 != ref1); CHECK (ref1 != nc1);
665 CHECK (nc1 != ref2); CHECK (ref2 != nc1);
667 CHECK (nc2 != nb1); CHECK (nb1 != nc2);
668 CHECK (nc2 != nb2); CHECK (nb2 != nc2);
669 CHECK (nc2 != ns1); CHECK (ns1 != nc2);
670 CHECK (nc2 != ns2); CHECK (ns2 != nc2);
671 CHECK (nc2 != nt1 ); CHECK (nt1 != nc2);
672 CHECK (nc2 != nt2 ); CHECK (nt2 != nc2);
673 CHECK (nc2 != nto1); CHECK (nto1 != nc2);
674 CHECK (nc2 != nto2); CHECK (nto2 != nc2);
675 CHECK (nc2 != ntd1); CHECK (ntd1 != nc2);
676 CHECK (nc2 != ntd2); CHECK (ntd2 != nc2);
677 CHECK (nc2 != nts1); CHECK (nts1 != nc2);
678 CHECK (nc2 != nts2); CHECK (nts2 != nc2);
679 CHECK (nc2 != nh1 ); CHECK (nh1 != nc2);
680 CHECK (nc2 != nh2 ); CHECK (nh2 != nc2);
681 CHECK (nc2 != rec1); CHECK (rec1 != nc2);
682 CHECK (nc2 != rec2); CHECK (rec2 != nc2);
683 CHECK (nc2 != ref1); CHECK (ref1 != nc2);
684 CHECK (nc2 != ref2); CHECK (ref2 != nc2);
686 CHECK (nb1 != nb2); CHECK (nb2 != nb1);
687 CHECK (nb1 != ns1); CHECK (ns1 != nb1);
688 CHECK (nb1 != ns2); CHECK (ns2 != nb1);
689 CHECK (nb1 != nt1 ); CHECK (nt1 != nb1);
690 CHECK (nb1 != nt2 ); CHECK (nt2 != nb1);
691 CHECK (nb1 != nto1); CHECK (nto1 != nb1);
692 CHECK (nb1 != nto2); CHECK (nto2 != nb1);
693 CHECK (nb1 != ntd1); CHECK (ntd1 != nb1);
694 CHECK (nb1 != ntd2); CHECK (ntd2 != nb1);
695 CHECK (nb1 != nts1); CHECK (nts1 != nb1);
696 CHECK (nb1 != nts2); CHECK (nts2 != nb1);
697 CHECK (nb1 != nh1 ); CHECK (nh1 != nb1);
698 CHECK (nb1 != nh2 ); CHECK (nh2 != nb1);
699 CHECK (nb1 != rec1); CHECK (rec1 != nb1);
700 CHECK (nb1 != rec2); CHECK (rec2 != nb1);
701 CHECK (nb1 != ref1); CHECK (ref1 != nb1);
702 CHECK (nb1 != ref2); CHECK (ref2 != nb1);
704 CHECK (nb2 != ns1); CHECK (ns1 != nb2);
705 CHECK (nb2 != ns2); CHECK (ns2 != nb2);
706 CHECK (nb2 != nt1 ); CHECK (nt1 != nb2);
707 CHECK (nb2 != nt2 ); CHECK (nt2 != nb2);
708 CHECK (nb2 != nto1); CHECK (nto1 != nb2);
709 CHECK (nb2 != nto2); CHECK (nto2 != nb2);
710 CHECK (nb2 != ntd1); CHECK (ntd1 != nb2);
711 CHECK (nb2 != ntd2); CHECK (ntd2 != nb2);
712 CHECK (nb2 != nts1); CHECK (nts1 != nb2);
713 CHECK (nb2 != nts2); CHECK (nts2 != nb2);
714 CHECK (nb2 != nh1 ); CHECK (nh1 != nb2);
715 CHECK (nb2 != nh2 ); CHECK (nh2 != nb2);
716 CHECK (nb2 != rec1); CHECK (rec1 != nb2);
717 CHECK (nb2 != rec2); CHECK (rec2 != nb2);
718 CHECK (nb2 != ref1); CHECK (ref1 != nb2);
719 CHECK (nb2 != ref2); CHECK (ref2 != nb2);
721 CHECK (ns1 != nt2 ); CHECK (nt2 != ns1);
722 CHECK (ns1 != nto1); CHECK (nto1 != ns1);
723 CHECK (ns1 != nto2); CHECK (nto2 != ns1);
724 CHECK (ns1 != ntd1); CHECK (ntd1 != ns1);
725 CHECK (ns1 != ntd2); CHECK (ntd2 != ns1);
726 CHECK (ns1 != nts1); CHECK (nts1 != ns1);
727 CHECK (ns1 != nts2); CHECK (nts2 != ns1);
728 CHECK (ns1 != nh1 ); CHECK (nh1 != ns1);
729 CHECK (ns1 != nh2 ); CHECK (nh2 != ns1);
730 CHECK (ns1 != rec1); CHECK (rec1 != ns1);
731 CHECK (ns1 != rec2); CHECK (rec2 != ns1);
732 CHECK (ns1 != ref1); CHECK (ref1 != ns1);
733 CHECK (ns1 != ref2); CHECK (ref2 != ns1);
735 CHECK (ns2 != nt1 ); CHECK (nt1 != ns2);
736 CHECK (ns2 != nt2 ); CHECK (nt2 != ns2);
737 CHECK (ns2 != nto1); CHECK (nto1 != ns2);
738 CHECK (ns2 != nto2); CHECK (nto2 != ns2);
739 CHECK (ns2 != ntd1); CHECK (ntd1 != ns2);
740 CHECK (ns2 != ntd2); CHECK (ntd2 != ns2);
741 CHECK (ns2 != nts1); CHECK (nts1 != ns2);
742 CHECK (ns2 != nts2); CHECK (nts2 != ns2);
743 CHECK (ns2 != nh1 ); CHECK (nh1 != ns2);
744 CHECK (ns2 != nh2 ); CHECK (nh2 != ns2);
745 CHECK (ns2 != rec1); CHECK (rec1 != ns2);
746 CHECK (ns2 != rec2); CHECK (rec2 != ns2);
747 CHECK (ns2 != ref1); CHECK (ref1 != ns2);
748 CHECK (ns2 != ref2); CHECK (ref2 != ns2);
750 CHECK (nt1 != nt2 ); CHECK (nt2 != nt1);
751 CHECK (nt1 != nto1); CHECK (nto1 != nt1);
752 CHECK (nt1 != nto2); CHECK (nto2 != nt1);
753 CHECK (nt1 != ntd1); CHECK (ntd1 != nt1);
754 CHECK (nt1 != ntd2); CHECK (ntd2 != nt1);
755 CHECK (nt1 != nts1); CHECK (nts1 != nt1);
756 CHECK (nt1 != nts2); CHECK (nts2 != nt1);
757 CHECK (nt1 != nh1 ); CHECK (nh1 != nt1);
758 CHECK (nt1 != nh2 ); CHECK (nh2 != nt1);
759 CHECK (nt1 != rec1); CHECK (rec1 != nt1);
760 CHECK (nt1 != rec2); CHECK (rec2 != nt1);
761 CHECK (nt1 != ref1); CHECK (ref1 != nt1);
762 CHECK (nt1 != ref2); CHECK (ref2 != nt1);
764 CHECK (nt2 != nto1); CHECK (nto1 != nt2);
765 CHECK (nt2 != nto2); CHECK (nto2 != nt2);
766 CHECK (nt2 != ntd1); CHECK (ntd1 != nt2);
767 CHECK (nt2 != ntd2); CHECK (ntd2 != nt2);
768 CHECK (nt2 != nts1); CHECK (nts1 != nt2);
769 CHECK (nt2 != nts2); CHECK (nts2 != nt2);
770 CHECK (nt2 != nh1 ); CHECK (nh1 != nt2);
771 CHECK (nt2 != nh2 ); CHECK (nh2 != nt2);
772 CHECK (nt2 != rec1); CHECK (rec1 != nt2);
773 CHECK (nt2 != rec2); CHECK (rec2 != nt2);
774 CHECK (nt2 != ref1); CHECK (ref1 != nt2);
775 CHECK (nt2 != ref2); CHECK (ref2 != nt2);
777 CHECK (nto1 != nto2); CHECK (nto2 != nto1);
778 CHECK (nto1 != ntd1); CHECK (ntd1 != nto1);
779 CHECK (nto1 != ntd2); CHECK (ntd2 != nto1);
780 CHECK (nto1 != nts1); CHECK (nts1 != nto1);
781 CHECK (nto1 != nts2); CHECK (nts2 != nto1);
782 CHECK (nto1 != nh1 ); CHECK (nh1 != nto1);
783 CHECK (nto1 != nh2 ); CHECK (nh2 != nto1);
784 CHECK (nto1 != rec1); CHECK (rec1 != nto1);
785 CHECK (nto1 != rec2); CHECK (rec2 != nto1);
786 CHECK (nto1 != ref1); CHECK (ref1 != nto1);
787 CHECK (nto1 != ref2); CHECK (ref2 != nto1);
789 CHECK (nto2 != ntd1); CHECK (ntd1 != nto2);
790 CHECK (nto2 != ntd2); CHECK (ntd2 != nto2);
791 CHECK (nto2 != nts1); CHECK (nts1 != nto2);
792 CHECK (nto2 != nts2); CHECK (nts2 != nto2);
793 CHECK (nto2 != nh1 ); CHECK (nh1 != nto2);
794 CHECK (nto2 != nh2 ); CHECK (nh2 != nto2);
795 CHECK (nto2 != rec1); CHECK (rec1 != nto2);
796 CHECK (nto2 != rec2); CHECK (rec2 != nto2);
797 CHECK (nto2 != ref1); CHECK (ref1 != nto2);
798 CHECK (nto2 != ref2); CHECK (ref2 != nto2);
800 CHECK (ntd1 != ntd2); CHECK (ntd2 != ntd1);
801 CHECK (ntd1 != nts1); CHECK (nts1 != ntd1);
802 CHECK (ntd1 != nts2); CHECK (nts2 != ntd1);
803 CHECK (ntd1 != nh1 ); CHECK (nh1 != ntd1);
804 CHECK (ntd1 != nh2 ); CHECK (nh2 != ntd1);
805 CHECK (ntd1 != rec1); CHECK (rec1 != ntd1);
806 CHECK (ntd1 != rec2); CHECK (rec2 != ntd1);
807 CHECK (ntd1 != ref1); CHECK (ref1 != ntd1);
808 CHECK (ntd1 != ref2); CHECK (ref2 != ntd1);
810 CHECK (ntd2 != nts1); CHECK (nts1 != ntd2);
811 CHECK (ntd2 != nts2); CHECK (nts2 != ntd2);
812 CHECK (ntd2 != nh1 ); CHECK (nh1 != ntd2);
813 CHECK (ntd2 != nh2 ); CHECK (nh2 != ntd2);
814 CHECK (ntd2 != rec1); CHECK (rec1 != ntd2);
815 CHECK (ntd2 != rec2); CHECK (rec2 != ntd2);
816 CHECK (ntd2 != ref1); CHECK (ref1 != ntd2);
817 CHECK (ntd2 != ref2); CHECK (ref2 != ntd2);
819 CHECK (nts1 != nts2); CHECK (nts2 != nts1);
820 CHECK (nts1 != nh1 ); CHECK (nh1 != nts1);
821 CHECK (nts1 != nh2 ); CHECK (nh2 != nts1);
822 CHECK (nts1 != rec1); CHECK (rec1 != nts1);
823 CHECK (nts1 != rec2); CHECK (rec2 != nts1);
824 CHECK (nts1 != ref1); CHECK (ref1 != nts1);
825 CHECK (nts1 != ref2); CHECK (ref2 != nts1);
827 CHECK (nts2 != nh1 ); CHECK (nh1 != nts2);
828 CHECK (nts2 != nh2 ); CHECK (nh2 != nts2);
829 CHECK (nts2 != rec1); CHECK (rec1 != nts2);
830 CHECK (nts2 != rec2); CHECK (rec2 != nts2);
831 CHECK (nts2 != ref1); CHECK (ref1 != nts2);
832 CHECK (nts2 != ref2); CHECK (ref2 != nts2);
834 CHECK (nh1 != nh2 ); CHECK (nh2 != nh1);
835 CHECK (nh1 != rec1); CHECK (rec1 != nh1);
836 CHECK (nh1 != rec2); CHECK (rec2 != nh1);
837 CHECK (nh1 != ref1); CHECK (ref1 != nh1);
838 CHECK (nh1 != ref2); CHECK (ref2 != nh1);
840 CHECK (nh2 != rec1); CHECK (rec1 != nh2);
841 CHECK (nh2 != rec2); CHECK (rec2 != nh2);
842 CHECK (nh2 != ref1); CHECK (ref1 != nh2);
843 CHECK (nh2 != ref2); CHECK (ref2 != nh2);
845 CHECK (rec1 != rec2); CHECK (rec2 != rec1);
846 CHECK (ref1 != ref2); CHECK (ref2 != ref1);
849 CHECK (rec1 == ref1); CHECK (ref1 == rec1);
850 CHECK (rec1 != ref2); CHECK (ref2 != rec1);
852 CHECK (rec2 != ref1); CHECK (ref1 != rec2);
853 CHECK (rec2 == ref2); CHECK (ref2 == rec2);
860 CHECK (ni1 .matches(ni1 )); CHECK (ni1 .matches(ni1 .idi)); CHECK (ni1 .matches(i1 ));
861 CHECK (ni2 .matches(ni2 )); CHECK (ni2 .matches(ni2 .idi)); CHECK (ni2 .matches(i2 ));
862 CHECK (nl1 .matches(nl1 )); CHECK (nl1 .matches(nl1 .idi)); CHECK (nl1 .matches(l1 ));
863 CHECK (nl2 .matches(nl2 )); CHECK (nl2 .matches(nl2 .idi)); CHECK (nl2 .matches(l2 ));
864 CHECK (nr1 .matches(nr1 )); CHECK (nr1 .matches(nr1 .idi)); CHECK (nr1 .matches(r1 ));
865 CHECK (nr2 .matches(nr2 )); CHECK (nr2 .matches(nr2 .idi)); CHECK (nr2 .matches(r2 ));
866 CHECK (nd1 .matches(nd1 )); CHECK (nd1 .matches(nd1 .idi)); CHECK (nd1 .matches(d1 ));
867 CHECK (nd2 .matches(nd2 )); CHECK (nd2 .matches(nd2 .idi)); CHECK (nd2 .matches(d2 ));
868 CHECK (nc1 .matches(nc1 )); CHECK (nc1 .matches(nc1 .idi)); CHECK (nc1 .matches(c1 ));
869 CHECK (nc2 .matches(nc2 )); CHECK (nc2 .matches(nc2 .idi)); CHECK (nc2 .matches(c2 ));
870 CHECK (nb1 .matches(nb1 )); CHECK (nb1 .matches(nb1 .idi)); CHECK (nb1 .matches(b1 ));
871 CHECK (nb2 .matches(nb2 )); CHECK (nb2 .matches(nb2 .idi)); CHECK (nb2 .matches(b2 ));
872 CHECK (ns1 .matches(ns1 )); CHECK (ns1 .matches(ns1 .idi)); CHECK (ns1 .matches(s1 ));
873 CHECK (ns2 .matches(ns2 )); CHECK (ns2 .matches(ns2 .idi)); CHECK (ns2 .matches(s2 ));
874 CHECK (nt1 .matches(nt1 )); CHECK (nt1 .matches(nt1 .idi)); CHECK (nt1 .matches(t1 ));
875 CHECK (nt2 .matches(nt2 )); CHECK (nt2 .matches(nt2 .idi)); CHECK (nt2 .matches(t2 ));
882 CHECK (nh1 .matches(nh1 )); CHECK (nh1 .matches(nh1 .idi)); CHECK (nh1 .matches(h1 ));
883 CHECK (nh2 .matches(nh2 )); CHECK (nh2 .matches(nh2 .idi)); CHECK (nh2 .matches(h2 ));
884 CHECK (rec1.matches(rec1)); CHECK (rec1.matches(rec1.idi)); CHECK (rec1.matches(spam1));
916 CHECK (rec1.matches(ref1.idi));
917 CHECK (ref1.
matches(rec1.idi));
918 CHECK (rec2.
matches(ref2.idi));
919 CHECK (ref2.
matches(rec2.idi));
943 CHECK (copy.idi == ni1.idi);
944 CHECK (not copy.data.matchData(ni1.data));
947 CHECK (copy.matches(ni1)); CHECK (ni1.
matches(copy));
964 CHECK (not n1.isNamed());
965 CHECK ( n2.isNamed());
966 CHECK (not n3.isNamed());
968 CHECK (not n1.isNested());
969 CHECK ( n2.isNested());
970 CHECK ( n3.isNested());
972 CHECK (n1.data.
recordType() == util::BOTTOM_INDICATOR);
974 CHECK (n3.data.
recordType() == Rec::TYPE_NIL );
976 CHECK (not n1.hasAttribute(
"baked beans"));
977 CHECK (not n2.hasAttribute(
"baked beans"));
978 CHECK (not n3.hasAttribute(
"baked beans"));
980 CHECK (not n1.hasAttribute(
"Ψ"));
981 CHECK (not n2.hasAttribute(
"Ψ"));
982 CHECK ( n3.hasAttribute(
"Ψ"));
995 CHECK (not n1.hasChildren());
996 CHECK (not n2.hasChildren());
997 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_"
Simplistic 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, based directly on the referee's memory identities. ...