summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-17 15:27:32 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-17 15:27:32 +0100
commit9eb32731b024d792b0aa212cbcd6bf07b8d6ccca (patch)
treeb085d0b42cb7b22ca2816c7f549994e1140381d3 /test
parent97b364112f0c9f3378011d6567433923f9fd8328 (diff)
Improved typesystem, allowing online creation of structs
Diffstat (limited to 'test')
-rw-r--r--test/core/model/TypesystemTest.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/core/model/TypesystemTest.cpp b/test/core/model/TypesystemTest.cpp
index c280716..5871092 100644
--- a/test/core/model/TypesystemTest.cpp
+++ b/test/core/model/TypesystemTest.cpp
@@ -578,23 +578,21 @@ TEST(StructType, createValidated)
new Attribute{mgr, "c", intType, 3},
new Attribute{mgr, "a", intType}},
logger)};
+ ASSERT_TRUE(structType->validate(logger));
ASSERT_EQ(Severity::DEBUG, logger.getMaxEncounteredSeverity());
}
{
logger.reset();
- try {
- 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)};
- } catch (LoggableException ex) {
- logger.log(ex);
- }
+ 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)};
+ ASSERT_FALSE(structType->validate(logger));
ASSERT_EQ(Severity::ERROR, logger.getMaxEncounteredSeverity());
}
@@ -608,6 +606,7 @@ TEST(StructType, createValidated)
new Attribute{mgr, "a", intType, 3},
new Attribute{mgr, "a a", intType}},
logger)};
+ ASSERT_FALSE(structType->validate(logger));
ASSERT_EQ(Severity::ERROR, logger.getMaxEncounteredSeverity());
}
}