Skip to content

Commit 86105fe

Browse files
committed
Extended unit test
1 parent e2d44e9 commit 86105fe

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

check/TestMipSolver.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,5 +1071,26 @@ TEST_CASE("get-fixed-lp", "[highs_test_mip_solver]") {
10711071
REQUIRE(h.getInfo().objective_function_value == mip_optimal_objective);
10721072
REQUIRE(h.getInfo().simplex_iteration_count == 0);
10731073

1074+
REQUIRE(h.readModel(model_file) == HighsStatus::kOk);
1075+
// Perturb one of the integer variables for code coverage of
1076+
// warning: makes fixed LP of flugpl infeasible
1077+
std::vector<HighsVarType> integrality = h.getLp().integrality_;
1078+
for (HighsInt iCol = 0; iCol < fixed_lp.num_col_; iCol++) {
1079+
if (integrality[iCol] != HighsVarType::kContinuous) {
1080+
solution.col_value[iCol] -= 0.01;
1081+
break;
1082+
}
1083+
}
1084+
1085+
REQUIRE(h.run() == HighsStatus::kOk);
1086+
h.setSolution(solution);
1087+
1088+
REQUIRE(h.getFixedLp(fixed_lp) == HighsStatus::kWarning);
1089+
1090+
REQUIRE(h.passModel(fixed_lp) == HighsStatus::kOk);
1091+
REQUIRE(h.run() == HighsStatus::kOk);
1092+
1093+
REQUIRE(h.getModelStatus() == HighsModelStatus::kInfeasible);
1094+
10741095
h.resetGlobalScheduler(true);
10751096
}

0 commit comments

Comments
 (0)