From 9eb32731b024d792b0aa212cbcd6bf07b8d6ccca Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sat, 17 Jan 2015 15:27:32 +0100 Subject: Improved typesystem, allowing online creation of structs --- test/core/model/TypesystemTest.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'test') 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::createValidated( - mgr, "struct", nullptr, nullptr, - NodeVector{ - 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::createValidated( + mgr, "struct", nullptr, nullptr, + NodeVector{ + 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()); } } -- cgit v1.2.3