Browse Source

factor out test state

tempestpy_adaptions
Tom Janson 8 years ago
parent
commit
3915a491cf
  1. 18
      test/functional/utility/KSPTest.cpp

18
test/functional/utility/KSPTest.cpp

@ -22,10 +22,11 @@ std::shared_ptr<storm::models::sparse::Model<double>> buildExampleModel() {
return storm::builder::ExplicitModelBuilder<double>(program).build();
}
const storm::utility::ksp::state_t testState = 300;
const storm::utility::ksp::state_t stateWithOnlyOnePath = 1;
TEST(KSPTest, dijkstra) {
auto model = buildExampleModel();
storm::utility::ksp::state_t testState = 300;
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState);
double dist = spg.getDistance(1);
@ -34,8 +35,6 @@ TEST(KSPTest, dijkstra) {
TEST(KSPTest, singleTarget) {
auto model = buildExampleModel();
storm::utility::ksp::state_t testState = 300;
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState);
double dist = spg.getDistance(100);
@ -44,8 +43,6 @@ TEST(KSPTest, singleTarget) {
TEST(KSPTest, reentry) {
auto model = buildExampleModel();
storm::utility::ksp::state_t testState = 300;
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState);
double dist = spg.getDistance(100);
@ -58,7 +55,6 @@ TEST(KSPTest, reentry) {
TEST(KSPTest, groupTarget) {
auto model = buildExampleModel();
auto groupTarget = std::vector<storm::utility::ksp::state_t>{50, 90};
auto spg = storm::utility::ksp::ShortestPathsGenerator<double>(*model, groupTarget);
@ -77,17 +73,13 @@ TEST(KSPTest, groupTarget) {
TEST(KSPTest, kTooLargeException) {
auto model = buildExampleModel();
storm::utility::ksp::state_t testState = 1;
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState);
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, stateWithOnlyOnePath);
ASSERT_THROW(spg.getDistance(2), std::invalid_argument);
}
TEST(KSPTest, kspStateSet) {
auto model = buildExampleModel();
storm::utility::ksp::state_t testState = 300;
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState);
storm::storage::BitVector referenceBV(model->getNumberOfStates(), false);
@ -102,8 +94,6 @@ TEST(KSPTest, kspStateSet) {
TEST(KSPTest, kspPathAsList) {
auto model = buildExampleModel();
storm::utility::ksp::state_t testState = 300;
storm::utility::ksp::ShortestPathsGenerator<double> spg(*model, testState);
// TODO: use path that actually has a loop or something to make this more interesting

Loading…
Cancel
Save