From 41b31df0ab7807276370d802c8a420d3e7fdc1fc Mon Sep 17 00:00:00 2001 From: dehnert Date: Mon, 7 Apr 2014 22:56:51 +0200 Subject: [PATCH] Added small tests for implies/iff in expressions. Former-commit-id: 3d90be7596820dd0f420999fabad196edbc29cd1 --- test/functional/storage/ExpressionTest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/functional/storage/ExpressionTest.cpp b/test/functional/storage/ExpressionTest.cpp index a7f789769..6563a749d 100644 --- a/test/functional/storage/ExpressionTest.cpp +++ b/test/functional/storage/ExpressionTest.cpp @@ -244,6 +244,18 @@ TEST(Expression, OperatorTest) { ASSERT_NO_THROW(tempExpression = storm::expressions::Expression::maximum(intVarExpression, doubleConstExpression)); EXPECT_TRUE(tempExpression.getReturnType() == storm::expressions::ExpressionReturnType::Double); + ASSERT_THROW(tempExpression = trueExpression.implies(piExpression), storm::exceptions::InvalidTypeException); + ASSERT_NO_THROW(tempExpression = trueExpression.implies(falseExpression)); + EXPECT_TRUE(tempExpression.getReturnType() == storm::expressions::ExpressionReturnType::Bool); + ASSERT_NO_THROW(tempExpression = boolVarExpression.implies(boolConstExpression)); + EXPECT_TRUE(tempExpression.getReturnType() == storm::expressions::ExpressionReturnType::Bool); + + ASSERT_THROW(tempExpression = trueExpression.iff(piExpression), storm::exceptions::InvalidTypeException); + ASSERT_NO_THROW(tempExpression = trueExpression.iff(falseExpression)); + EXPECT_TRUE(tempExpression.getReturnType() == storm::expressions::ExpressionReturnType::Bool); + ASSERT_NO_THROW(tempExpression = boolVarExpression.iff(boolConstExpression)); + EXPECT_TRUE(tempExpression.getReturnType() == storm::expressions::ExpressionReturnType::Bool); + ASSERT_THROW(tempExpression = trueExpression.floor(), storm::exceptions::InvalidTypeException); ASSERT_NO_THROW(tempExpression = threeExpression.floor()); EXPECT_TRUE(tempExpression.getReturnType() == storm::expressions::ExpressionReturnType::Int);