diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-19 00:29:02 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-19 00:29:02 +0100 |
commit | 55d363bea503c0607c80604280c26c235a5d7ee1 (patch) | |
tree | bfa745de7de0c4c40f83b1b815daa45045570d1e /test | |
parent | d4e06ab60b382581887290876337976a48f50f71 (diff) |
refactored DomainTest somewhat to prevent an unused function warning.
Diffstat (limited to 'test')
-rw-r--r-- | test/core/model/DomainTest.cpp | 2 | ||||
-rw-r--r-- | test/core/model/TestDomain.hpp (renamed from test/core/model/ModelTestUtils.hpp) | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/test/core/model/DomainTest.cpp b/test/core/model/DomainTest.cpp index 57ec91c..f6dff3c 100644 --- a/test/core/model/DomainTest.cpp +++ b/test/core/model/DomainTest.cpp @@ -22,7 +22,7 @@ #include <core/model/Domain.hpp> -#include "ModelTestUtils.hpp" +#include "TestDomain.hpp" namespace ousia { namespace model { diff --git a/test/core/model/ModelTestUtils.hpp b/test/core/model/TestDomain.hpp index 665e351..41fcdef 100644 --- a/test/core/model/ModelTestUtils.hpp +++ b/test/core/model/TestDomain.hpp @@ -16,8 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _MODEL_TEST_UTILS_HPP_ -#define _MODEL_TEST_UTILS_HPP_ +#ifndef _MODEL_TEST_DOMAIN_HPP_ +#define _MODEL_TEST_DOMAIN_HPP_ #include <core/model/Domain.hpp> #include <core/model/Typesystem.hpp> @@ -28,20 +28,23 @@ namespace model { /** * This constructs a somewhat trivial system of standard types. * - * Currently contained: string + * Currently contained: string, text (struct wrapper for string) */ static Rooted<Typesystem> constructTypeSystem(Manager &mgr) { Rooted<Typesystem> sys{new Typesystem(mgr, "std")}; Rooted<StringType> string{new StringType(mgr, sys)}; sys->addType(string); + Rooted<StructType> string_struct{new StructType( + mgr, "text", sys, {{"content", "", false, sys->acquire(string)}})}; + sys->addType(string_struct); return sys; } /** * This constructs the "book" domain for test purposes. The structure of the - * domain is fairly and can be seen from the construction itself. + * domain is fairly simple and can be seen from the construction itself. */ static Rooted<Domain> constructBookDomain(Manager &mgr) { @@ -77,14 +80,15 @@ static Rooted<Domain> constructBookDomain(Manager &mgr) section_field->getChildren().push_back(paragraph); book_field->getChildren().push_back(paragraph); // ... and has a primitive field. - Rooted<FieldDescriptor> text{new FieldDescriptor( - mgr, paragraph, domain->getTypesystems()[0]->getTypes()[0], "text", + Rooted<FieldDescriptor> paragraph_field{new FieldDescriptor( + mgr, paragraph, domain->getTypesystems()[0]->getTypes()[1], "text", false)}; + paragraph->getFieldDescriptors().push_back(paragraph_field); return domain; } } } -#endif /* _TEST_MANAGED_H_ */ +#endif /* _TEST_DOMAIN_HPP_ */ |