You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.5 KiB

  1. #include "gtest/gtest.h"
  2. #include "storm-config.h"
  3. #include "src/parser/PrismParser.h"
  4. //#include "src/utility/IoUtility.h"
  5. #include "src/ir/Program.h"
  6. #include "src/adapters/ExplicitModelAdapter.h"
  7. #include "src/models/Dtmc.h"
  8. #include "src/models/Mdp.h"
  9. #include "src/settings/Settings.h"
  10. #include "src/settings/InternalOptionMemento.h"
  11. TEST(ParsePrismTest, parseCrowds5_5) {
  12. storm::settings::InternalOptionMemento deadlockOption("fixDeadlocks", true);
  13. ASSERT_TRUE(storm::settings::Settings::getInstance()->isSet("fixDeadlocks"));
  14. storm::ir::Program program;
  15. ASSERT_NO_THROW(program = storm::parser::PrismParserFromFile(STORM_CPP_BASE_PATH "/examples/dtmc/crowds/crowds5_5.pm"));
  16. std::shared_ptr<storm::models::AbstractModel<double>> model = storm::adapters::ExplicitModelAdapter<double>::translateProgram(program);
  17. ASSERT_EQ(model->getNumberOfStates(), 8607ull);
  18. ASSERT_EQ(model->getNumberOfTransitions(), 15113ull);
  19. }
  20. TEST(ParsePrismTest, parseTwoDice) {
  21. storm::ir::Program program;
  22. ASSERT_NO_THROW(program = storm::parser::PrismParserFromFile(STORM_CPP_BASE_PATH "/examples/mdp/two_dice/two_dice.nm"));
  23. std::shared_ptr<storm::models::AbstractModel<double>> model = storm::adapters::ExplicitModelAdapter<double>::translateProgram(program, "", "coinflips");
  24. ASSERT_EQ(model->getNumberOfStates(), 169ull);
  25. ASSERT_EQ(model->as<storm::models::AbstractNondeterministicModel<double>>()->getNumberOfChoices(), 254ull);
  26. ASSERT_EQ(model->getNumberOfTransitions(), 436ull);
  27. }