summaryrefslogtreecommitdiff
path: root/test/core
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-14 00:10:59 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-14 00:10:59 +0100
commitc79a672f8f3326907b522802e4d6750418a7572a (patch)
tree739fc77b39a0a4c9a234e7d05db5f1e78d9aa09f /test/core
parentb65781e2158a362025741a405fcaa7e54f4b7733 (diff)
started to implement a more advanced test for the 'pathTo' method and noticed some conceptual difficulties that have to be adressed later on.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/model/DomainTest.cpp29
1 files changed, 29 insertions, 0 deletions
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<SystemTypesystem> sys{new SystemTypesystem(mgr)};
+ // Get the domain.
+ Rooted<Domain> domain {new Domain(mgr, sys, "nasty")};
+ Cardinality any;
+ any.merge(Range<size_t>::typeRangeFrom(0));
+
+ // Our root class A
+ Rooted<StructuredClass> A{new StructuredClass(
+ mgr, "A", domain, any, {nullptr}, {nullptr}, false, true)};
+ domain->addStructuredClass(book);
+ // We also create a field for it.
+ Rooted<FieldDescriptor> A_field{new FieldDescriptor(mgr, A)};
+ A->addFieldDescriptor(A_field);
+
+ // our first transparent child B
+ Rooted<StructuredClass> B{new StructuredClass(
+ mgr, "B", domain, any, {nullptr}, {nullptr}, true)};
+ A_field->addChild(B);
+
+ //TODO: Continue
+}
+
}
}