From c79a672f8f3326907b522802e4d6750418a7572a Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Wed, 14 Jan 2015 00:10:59 +0100 Subject: started to implement a more advanced test for the 'pathTo' method and noticed some conceptual difficulties that have to be adressed later on. --- test/core/model/DomainTest.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test') diff --git a/test/core/model/DomainTest.cpp b/test/core/model/DomainTest.cpp index d22c845..dae3ba4 100644 --- a/test/core/model/DomainTest.cpp +++ b/test/core/model/DomainTest.cpp @@ -122,5 +122,34 @@ TEST(Descriptor, pathTo) // this should be impossible. ASSERT_EQ(0, path.size()); } + +TEST(Descriptor, pathToAdvanced) +{ + // Now we build a really nasty domain with lots of transparency + // and inheritance + Logger logger; + Manager mgr{1}; + Rooted sys{new SystemTypesystem(mgr)}; + // Get the domain. + Rooted domain {new Domain(mgr, sys, "nasty")}; + Cardinality any; + any.merge(Range::typeRangeFrom(0)); + + // Our root class A + Rooted A{new StructuredClass( + mgr, "A", domain, any, {nullptr}, {nullptr}, false, true)}; + domain->addStructuredClass(book); + // We also create a field for it. + Rooted A_field{new FieldDescriptor(mgr, A)}; + A->addFieldDescriptor(A_field); + + // our first transparent child B + Rooted B{new StructuredClass( + mgr, "B", domain, any, {nullptr}, {nullptr}, true)}; + A_field->addChild(B); + + //TODO: Continue +} + } } -- cgit v1.2.3