From eab6577b066319aab7ebaf514e6bb7aab9590624 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 25 Jan 2015 15:50:52 +0100 Subject: removed cardinality type definition from Domain.hpp and made everything compatible with the Variant cardinality. --- test/core/model/DocumentTest.cpp | 2 +- test/core/model/DomainTest.cpp | 8 ++++---- test/core/model/TestAdvanced.hpp | 6 +++--- test/core/model/TestDomain.hpp | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/core/model/DocumentTest.cpp b/test/core/model/DocumentTest.cpp index e07deb8..1d8457c 100644 --- a/test/core/model/DocumentTest.cpp +++ b/test/core/model/DocumentTest.cpp @@ -117,7 +117,7 @@ TEST(Document, validate) Manager mgr{1}; Rooted sys{new SystemTypesystem(mgr)}; Rooted domain{new Domain(mgr, sys, "trivial")}; - Cardinality single; + Variant::cardinalityType single; single.merge({1}); // Set up the "root" StructuredClass. Rooted rootClass{new StructuredClass( diff --git a/test/core/model/DomainTest.cpp b/test/core/model/DomainTest.cpp index c00b122..54fd86a 100644 --- a/test/core/model/DomainTest.cpp +++ b/test/core/model/DomainTest.cpp @@ -152,8 +152,8 @@ TEST(Descriptor, pathToAdvanced) Rooted sys{new SystemTypesystem(mgr)}; // Construct the domain Rooted domain{new Domain(mgr, sys, "nasty")}; - Cardinality any; - any.merge(Range::typeRangeFrom(0)); + Variant::cardinalityType any; + any.merge(Range::typeRange()); // Let's create the classes that we need first Rooted A{new StructuredClass( @@ -225,8 +225,8 @@ TEST(StructuredClass, isSubclassOf) Manager mgr{1}; Rooted sys{new SystemTypesystem(mgr)}; Rooted domain{new Domain(mgr, sys, "inheritance")}; - Cardinality any; - any.merge(Range::typeRangeFrom(0)); + Variant::cardinalityType any; + any.merge(Range::typeRange()); Rooted A{new StructuredClass( mgr, "A", domain, any, {nullptr}, {nullptr}, false, true)}; // first branch diff --git a/test/core/model/TestAdvanced.hpp b/test/core/model/TestAdvanced.hpp index f8585d1..6f8ca33 100644 --- a/test/core/model/TestAdvanced.hpp +++ b/test/core/model/TestAdvanced.hpp @@ -53,7 +53,7 @@ static Rooted constructHeadingDomain(Manager &mgr, // set up domain node. Rooted domain{new Domain(mgr, sys, "headings")}; // set up cardinality (every section may have at most one heading). - Cardinality card; + Variant::cardinalityType card; card.merge({0, 1}); // set up heading StructuredClass. Rooted heading{new StructuredClass( @@ -84,8 +84,8 @@ static Rooted constructListDomain(Manager &mgr, // set up domain node. Rooted domain{new Domain(mgr, sys, "list")}; // set up cardinality - Cardinality any; - any.merge(Range::typeRangeFrom(0)); + Variant::cardinalityType any; + any.merge(Range::typeRange()); // get book.paragraph Rooted p = resolveDescriptor(bookDomain, "paragraph"); // set up item StructuredClass; diff --git a/test/core/model/TestDomain.hpp b/test/core/model/TestDomain.hpp index f6b8805..ec63216 100644 --- a/test/core/model/TestDomain.hpp +++ b/test/core/model/TestDomain.hpp @@ -36,10 +36,10 @@ static Rooted constructBookDomain(Manager &mgr, // Start with the Domain itself. Rooted domain{new Domain(mgr, sys, "book")}; // Set up the cardinalities we'll need. - Cardinality single; + Variant::cardinalityType single; single.merge({1}); - Cardinality any; - any.merge(Range::typeRangeFrom(0)); + Variant::cardinalityType any; + any.merge(Range::typeRange()); // Set up the "book" node. Rooted book{new StructuredClass( -- cgit v1.2.3