summaryrefslogtreecommitdiff
path: root/test/core
diff options
context:
space:
mode:
Diffstat (limited to 'test/core')
-rw-r--r--test/core/model/DocumentTest.cpp2
-rw-r--r--test/core/model/DomainTest.cpp8
-rw-r--r--test/core/model/TestAdvanced.hpp2
-rw-r--r--test/core/model/TestDocument.hpp2
-rw-r--r--test/core/model/TestDocumentBuilder.hpp2
-rw-r--r--test/core/model/TestDomain.hpp3
-rw-r--r--test/core/model/TypesystemTest.cpp87
7 files changed, 43 insertions, 63 deletions
diff --git a/test/core/model/DocumentTest.cpp b/test/core/model/DocumentTest.cpp
index e07deb8..a09068d 100644
--- a/test/core/model/DocumentTest.cpp
+++ b/test/core/model/DocumentTest.cpp
@@ -29,7 +29,6 @@
#include "TestDomain.hpp"
namespace ousia {
-namespace model {
TEST(Document, construct)
{
@@ -308,4 +307,3 @@ TEST(Document, validate)
}
}
}
-}
diff --git a/test/core/model/DomainTest.cpp b/test/core/model/DomainTest.cpp
index c00b122..fc71f91 100644
--- a/test/core/model/DomainTest.cpp
+++ b/test/core/model/DomainTest.cpp
@@ -27,7 +27,6 @@
#include "TestDomain.hpp"
namespace ousia {
-namespace model {
void assert_path(const ResolutionResult &res, const Rtti &expected_type,
std::vector<std::string> expected_path)
@@ -335,8 +334,7 @@ TEST(Domain, validate)
ASSERT_EQ(ValidationState::UNKNOWN, domain->getValidationState());
ASSERT_TRUE(domain->validate(logger));
// add a subclass for our base class.
- Rooted<StructuredClass> sub{
- new StructuredClass(mgr, "sub", domain)};
+ Rooted<StructuredClass> sub{new StructuredClass(mgr, "sub", domain)};
// this should be valid in itself.
ASSERT_EQ(ValidationState::UNKNOWN, domain->getValidationState());
ASSERT_TRUE(domain->validate(logger));
@@ -355,8 +353,7 @@ TEST(Domain, validate)
ASSERT_TRUE(domain->validate(logger));
ASSERT_EQ(base, sub->getSuperclass());
// add a non-primitive field to the child class.
- Rooted<FieldDescriptor> sub_field{
- new FieldDescriptor(mgr, sub)};
+ Rooted<FieldDescriptor> sub_field{new FieldDescriptor(mgr, sub)};
// this should be valid
ASSERT_EQ(ValidationState::UNKNOWN, domain->getValidationState());
ASSERT_TRUE(domain->validate(logger));
@@ -383,4 +380,3 @@ TEST(Domain, validate)
}
}
}
-}
diff --git a/test/core/model/TestAdvanced.hpp b/test/core/model/TestAdvanced.hpp
index f8585d1..6111170 100644
--- a/test/core/model/TestAdvanced.hpp
+++ b/test/core/model/TestAdvanced.hpp
@@ -26,7 +26,6 @@
#include "TestDocumentBuilder.hpp"
namespace ousia {
-namespace model {
static Rooted<StructuredClass> resolveDescriptor(Handle<Domain> domain,
const std::string &className)
@@ -316,6 +315,5 @@ static Rooted<Document> constructAdvancedDocument(Manager &mgr, Logger &logger,
return doc;
}
}
-}
#endif /* _TEST_DOCUMENT_HPP_ */
diff --git a/test/core/model/TestDocument.hpp b/test/core/model/TestDocument.hpp
index 2397fe6..243672b 100644
--- a/test/core/model/TestDocument.hpp
+++ b/test/core/model/TestDocument.hpp
@@ -26,7 +26,6 @@
#include "TestDocumentBuilder.hpp"
namespace ousia {
-namespace model {
/**
* This constructs a fairly simple test document for the "book" domain. The
@@ -88,7 +87,6 @@ static Rooted<Document> constructBookDocument(Manager &mgr, Logger &logger,
return doc;
}
}
-}
#endif /* _TEST_DOCUMENT_HPP_ */
diff --git a/test/core/model/TestDocumentBuilder.hpp b/test/core/model/TestDocumentBuilder.hpp
index 63d60eb..149b88e 100644
--- a/test/core/model/TestDocumentBuilder.hpp
+++ b/test/core/model/TestDocumentBuilder.hpp
@@ -27,7 +27,6 @@
#include <core/model/Typesystem.hpp>
namespace ousia {
-namespace model {
typedef std::vector<std::string> Path;
@@ -215,5 +214,4 @@ Rooted<AnnotationEntity> buildAnnotationEntity(
return anno;
}
}
-}
#endif
diff --git a/test/core/model/TestDomain.hpp b/test/core/model/TestDomain.hpp
index f6b8805..35f1ce1 100644
--- a/test/core/model/TestDomain.hpp
+++ b/test/core/model/TestDomain.hpp
@@ -23,8 +23,6 @@
#include <core/model/Typesystem.hpp>
namespace ousia {
-namespace model {
-
/**
* This constructs the "book" domain for test purposes. The structure of the
* domain is fairly simple and can be seen from the construction itself.
@@ -91,6 +89,5 @@ static Rooted<Domain> constructBookDomain(Manager &mgr,
return domain;
}
}
-}
#endif /* _TEST_DOMAIN_HPP_ */
diff --git a/test/core/model/TypesystemTest.cpp b/test/core/model/TypesystemTest.cpp
index 4d1d2c9..7d05f56 100644
--- a/test/core/model/TypesystemTest.cpp
+++ b/test/core/model/TypesystemTest.cpp
@@ -25,10 +25,9 @@
#include <core/model/Typesystem.hpp>
namespace ousia {
-namespace model {
static TerminalLogger logger(std::cerr, true);
-//static ConcreteLogger logger;
+// static ConcreteLogger logger;
/* Class StringType */
@@ -519,28 +518,28 @@ TEST(StructType, creationWithParent)
Manager mgr{1};
Rooted<StructType> structType = createStructType(mgr, logger);
{
- Rooted<StructType> structWithParentType =
- createStructTypeWithParent(structType, mgr, logger);
+ Rooted<StructType> structWithParentType =
+ createStructTypeWithParent(structType, mgr, logger);
- Variant val = structWithParentType->create();
- ASSERT_TRUE(val.isArray());
- ASSERT_EQ(7U, val.asArray().size());
+ Variant val = structWithParentType->create();
+ ASSERT_TRUE(val.isArray());
+ ASSERT_EQ(7U, val.asArray().size());
- const auto &arr = val.asArray();
- ASSERT_TRUE(arr[0].isString());
- ASSERT_TRUE(arr[1].isString());
- ASSERT_TRUE(arr[2].isInt());
- ASSERT_TRUE(arr[3].isInt());
- ASSERT_TRUE(arr[4].isString());
- ASSERT_TRUE(arr[5].isInt());
- ASSERT_TRUE(arr[6].isArray());
+ const auto &arr = val.asArray();
+ ASSERT_TRUE(arr[0].isString());
+ ASSERT_TRUE(arr[1].isString());
+ ASSERT_TRUE(arr[2].isInt());
+ ASSERT_TRUE(arr[3].isInt());
+ ASSERT_TRUE(arr[4].isString());
+ ASSERT_TRUE(arr[5].isInt());
+ ASSERT_TRUE(arr[6].isArray());
- ASSERT_EQ("attr1default", arr[0].asString());
- ASSERT_EQ("", arr[1].asString());
- ASSERT_EQ(3, arr[2].asInt());
- ASSERT_EQ(0, arr[3].asInt());
- ASSERT_EQ("value1", arr[4].asString());
- ASSERT_EQ(42, arr[5].asInt());
+ ASSERT_EQ("attr1default", arr[0].asString());
+ ASSERT_EQ("", arr[1].asString());
+ ASSERT_EQ(3, arr[2].asInt());
+ ASSERT_EQ(0, arr[3].asInt());
+ ASSERT_EQ("value1", arr[4].asString());
+ ASSERT_EQ(42, arr[5].asInt());
}
}
@@ -566,13 +565,13 @@ TEST(StructType, createValidated)
{
logger.reset();
Rooted<StructType> structType{StructType::createValidated(
- mgr, "struct", nullptr, nullptr,
- NodeVector<Attribute>{
- new Attribute{mgr, "d", stringType, "attr1default"},
- new Attribute{mgr, "b", stringType},
- new Attribute{mgr, "c", intType, 3},
- new Attribute{mgr, "a", intType}},
- logger)};
+ mgr, "struct", nullptr, nullptr,
+ NodeVector<Attribute>{
+ new Attribute{mgr, "d", stringType, "attr1default"},
+ new Attribute{mgr, "b", stringType},
+ new Attribute{mgr, "c", intType, 3},
+ new Attribute{mgr, "a", intType}},
+ logger)};
ASSERT_TRUE(structType->validate(logger));
ASSERT_EQ(Severity::DEBUG, logger.getMaxEncounteredSeverity());
}
@@ -580,13 +579,13 @@ TEST(StructType, createValidated)
{
logger.reset();
Rooted<StructType> structType{StructType::createValidated(
- mgr, "struct", nullptr, nullptr,
- NodeVector<Attribute>{
- new Attribute{mgr, "d", stringType, "attr1default"},
- new Attribute{mgr, "b", stringType},
- new Attribute{mgr, "a", intType, 3},
- new Attribute{mgr, "a", intType}},
- logger)};
+ mgr, "struct", nullptr, nullptr,
+ NodeVector<Attribute>{
+ new Attribute{mgr, "d", stringType, "attr1default"},
+ new Attribute{mgr, "b", stringType},
+ new Attribute{mgr, "a", intType, 3},
+ new Attribute{mgr, "a", intType}},
+ logger)};
ASSERT_FALSE(structType->validate(logger));
ASSERT_EQ(Severity::ERROR, logger.getMaxEncounteredSeverity());
}
@@ -594,13 +593,13 @@ TEST(StructType, createValidated)
{
logger.reset();
Rooted<StructType> structType{StructType::createValidated(
- mgr, "struct", nullptr, nullptr,
- NodeVector<Attribute>{
- new Attribute{mgr, "d", stringType, "attr1default"},
- new Attribute{mgr, "b", stringType},
- new Attribute{mgr, "a", intType, 3},
- new Attribute{mgr, "a a", intType}},
- logger)};
+ mgr, "struct", nullptr, nullptr,
+ NodeVector<Attribute>{
+ new Attribute{mgr, "d", stringType, "attr1default"},
+ new Attribute{mgr, "b", stringType},
+ new Attribute{mgr, "a", intType, 3},
+ new Attribute{mgr, "a a", intType}},
+ logger)};
ASSERT_FALSE(structType->validate(logger));
ASSERT_EQ(Severity::ERROR, logger.getMaxEncounteredSeverity());
}
@@ -704,7 +703,6 @@ TEST(StructType, build)
ASSERT_EQ(5, arr[3].asInt());
}
-
// All mandatory attributes given as array
{
Variant var{{"v1", 2, 3, 4}};
@@ -923,7 +921,4 @@ TEST(SystemTypesystem, rtti)
ASSERT_FALSE(typesystem->composedOf(RttiTypes::Typesystem));
ASSERT_FALSE(typesystem->composedOf(RttiTypes::SystemTypesystem));
}
-
-
-}
}