From b14f866e01533099631bfc63622c9585952c6309 Mon Sep 17 00:00:00 2001 From: dehnert Date: Tue, 9 Aug 2016 22:06:59 +0200 Subject: [PATCH] added more flatten tests Former-commit-id: 7e35a90c884ff7f68930b4e3aabe1d121dfb772f --- test/functional/storage/PrismProgramTest.cpp | 42 +++++++++++++++----- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/test/functional/storage/PrismProgramTest.cpp b/test/functional/storage/PrismProgramTest.cpp index b6a5d1264..e8ea63c98 100644 --- a/test/functional/storage/PrismProgramTest.cpp +++ b/test/functional/storage/PrismProgramTest.cpp @@ -8,20 +8,44 @@ #ifdef STORM_HAVE_MSAT TEST(PrismProgramTest, FlattenModules) { - storm::prism::Program result; - ASSERT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/leader3.nm")); + storm::prism::Program program; + ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/leader3.nm")); std::shared_ptr smtSolverFactory = std::make_shared(); - ASSERT_NO_THROW(result = result.flattenModules(smtSolverFactory)); - EXPECT_EQ(1, result.getNumberOfModules()); - EXPECT_EQ(74, result.getModule(0).getNumberOfCommands()); + ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory)); + EXPECT_EQ(1, program.getNumberOfModules()); + EXPECT_EQ(74, program.getModule(0).getNumberOfCommands()); - ASSERT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/wlan0_collide.nm")); + ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/wlan0_collide.nm")); - ASSERT_NO_THROW(result = result.flattenModules(smtSolverFactory)); - EXPECT_EQ(1, result.getNumberOfModules()); - EXPECT_EQ(180, result.getModule(0).getNumberOfCommands()); + ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory)); + EXPECT_EQ(1, program.getNumberOfModules()); + EXPECT_EQ(180, program.getModule(0).getNumberOfCommands()); + + ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/csma2_2.nm")); + + ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory)); + EXPECT_EQ(1, program.getNumberOfModules()); + EXPECT_EQ(71, program.getModule(0).getNumberOfCommands()); + + ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/firewire.nm")); + + ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory)); + EXPECT_EQ(1, program.getNumberOfModules()); + EXPECT_EQ(5026, program.getModule(0).getNumberOfCommands()); + + ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/coin2.nm")); + + ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory)); + EXPECT_EQ(1, program.getNumberOfModules()); + EXPECT_EQ(13, program.getModule(0).getNumberOfCommands()); + + ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/two_dice.nm")); + + ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory)); + EXPECT_EQ(1, program.getNumberOfModules()); + EXPECT_EQ(16, program.getModule(0).getNumberOfCommands()); } #endif