Browse Source

Fixed missing include in InternalSylvanAdd.cpp

Added simple test for Sylvan + RationalFunctions.


Former-commit-id: ffb747a861
tempestpy_adaptions
PBerger 8 years ago
parent
commit
07d4848f55
  1. 2
      src/storage/dd/sylvan/InternalSylvanAdd.cpp
  2. 29
      test/functional/storage/SylvanDdTest.cpp

2
src/storage/dd/sylvan/InternalSylvanAdd.cpp

@ -10,6 +10,8 @@
#include "src/utility/constants.h"
#include "src/exceptions/NotImplementedException.h"
#include "storm-config.h"
namespace storm {
namespace dd {
template<typename ValueType>

29
test/functional/storage/SylvanDdTest.cpp

@ -1,6 +1,7 @@
#include "gtest/gtest.h"
#include "storm-config.h"
#include "src/adapters/CarlAdapter.h"
#include "src/exceptions/InvalidArgumentException.h"
#include "src/storage/dd/DdManager.h"
#include "src/storage/dd/Add.h"
@ -40,6 +41,34 @@ TEST(SylvanDd, Constants) {
EXPECT_EQ(2, two.getMax());
}
#ifdef STORM_HAVE_CARL
TEST(SylvanDd, RationalFunctionConstants) {
std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::Sylvan>> manager(new storm::dd::DdManager<storm::dd::DdType::Sylvan>());
storm::dd::Add<storm::dd::DdType::Sylvan, storm::RationalFunction> zero;
ASSERT_NO_THROW(zero = manager->template getAddZero<storm::RationalFunction>());
EXPECT_EQ(0ul, zero.getNonZeroCount());
EXPECT_EQ(1ul, zero.getLeafCount());
EXPECT_EQ(1ul, zero.getNodeCount());
storm::dd::Add<storm::dd::DdType::Sylvan, storm::RationalFunction> one;
ASSERT_NO_THROW(one = manager->template getAddOne<storm::RationalFunction>());
EXPECT_EQ(0ul, one.getNonZeroCount());
EXPECT_EQ(1ul, one.getLeafCount());
EXPECT_EQ(1ul, one.getNodeCount());
storm::dd::Add<storm::dd::DdType::Sylvan, storm::RationalFunction> two;
storm::RationalFunction constantTwo(2);
ASSERT_NO_THROW(two = manager->template getConstant<storm::RationalFunction>(constantTwo));
EXPECT_EQ(0ul, two.getNonZeroCount());
EXPECT_EQ(1ul, two.getLeafCount());
EXPECT_EQ(1ul, two.getNodeCount());
}
#endif
TEST(SylvanDd, AddGetMetaVariableTest) {
std::shared_ptr<storm::dd::DdManager<storm::dd::DdType::Sylvan>> manager(new storm::dd::DdManager<storm::dd::DdType::Sylvan>());
ASSERT_NO_THROW(manager->addMetaVariable("x", 1, 9));

Loading…
Cancel
Save