Browse Source

Corrected test formulation in case StoRM was built without support for a given LP solver.

Former-commit-id: 7ae692f274
tempestpy_adaptions
dehnert 11 years ago
parent
commit
ef5eb19e9c
  1. 16
      test/functional/solver/GlpkLpSolverTest.cpp
  2. 16
      test/functional/solver/GurobiLpSolverTest.cpp

16
test/functional/solver/GlpkLpSolverTest.cpp

@ -36,7 +36,7 @@ TEST(GlpkLpSolver, LPOptimizeMax) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - 14.75), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - 14.75), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }
@ -71,7 +71,7 @@ TEST(GlpkLpSolver, LPOptimizeMin) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - (-6.7)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - (-6.7)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }
@ -106,7 +106,7 @@ TEST(GlpkLpSolver, MILPOptimizeMax) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - 14), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - 14), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }
@ -141,7 +141,7 @@ TEST(GlpkLpSolver, MILPOptimizeMin) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - (-6)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - (-6)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }
@ -173,7 +173,7 @@ TEST(GlpkLpSolver, LPInfeasible) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }
@ -205,7 +205,7 @@ TEST(GlpkLpSolver, MILPInfeasible) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }
@ -235,7 +235,7 @@ TEST(GlpkLpSolver, LPUnbounded) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }
@ -265,6 +265,6 @@ TEST(GlpkLpSolver, MILPUnbounded) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without glpk support.");
ASSERT_TRUE(false) << "StoRM built without glpk support.";
#endif #endif
} }

16
test/functional/solver/GurobiLpSolverTest.cpp

@ -36,7 +36,7 @@ TEST(GurobiLpSolver, LPOptimizeMax) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - 14.75), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - 14.75), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
@ -71,7 +71,7 @@ TEST(GurobiLpSolver, LPOptimizeMin) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - (-6.7)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - (-6.7)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
@ -106,7 +106,7 @@ TEST(GurobiLpSolver, MILPOptimizeMax) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - 14), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - 14), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
@ -141,7 +141,7 @@ TEST(GurobiLpSolver, MILPOptimizeMin) {
ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue()); ASSERT_NO_THROW(objectiveValue = solver.getObjectiveValue());
ASSERT_LT(std::abs(objectiveValue - (-6)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble()); ASSERT_LT(std::abs(objectiveValue - (-6)), storm::settings::Settings::getInstance()->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
@ -173,7 +173,7 @@ TEST(GurobiLpSolver, LPInfeasible) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
@ -205,7 +205,7 @@ TEST(GurobiLpSolver, MILPInfeasible) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
@ -235,7 +235,7 @@ TEST(GurobiLpSolver, LPUnbounded) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
@ -265,6 +265,6 @@ TEST(GurobiLpSolver, MILPUnbounded) {
double objectiveValue = 0; double objectiveValue = 0;
ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException); ASSERT_THROW(objectiveValue = solver.getObjectiveValue(), storm::exceptions::InvalidStateException);
#else #else
ASSERT_TRUE(false, "StoRM built without Gurobi support.");
ASSERT_TRUE(false) << "StoRM built without Gurobi support.";
#endif #endif
} }
Loading…
Cancel
Save