Skip to content

Commit

Permalink
Merge pull request #252 from scipopt/add-indicator-test-fix
Browse files Browse the repository at this point in the history
adapt test to version
  • Loading branch information
matbesancon authored Nov 21, 2022
2 parents 3bb8d15 + 393b81c commit d451668
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/MOI_additional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ end
@test MOI.get(optimizer, MOI.DualStatus()) == MOI.NO_SOLUTION
end

@testset "broken indicator test" for presolving in (-1, 0)
@testset "broken indicator test" for presolving in (1, 0)
model = MOIB.full_bridge_optimizer(SCIP.Optimizer(display_verblevel=0, presolving_maxrounds=presolving), Float64)
config = MOIT.Config(atol=5e-3, rtol=1e-4, exclude=Any[
MOI.ConstraintDual, MOI.ConstraintName, MOI.DualObjectiveValue, MOI.VariableBasisStatus, MOI.ConstraintBasisStatus,
Expand Down Expand Up @@ -380,16 +380,18 @@ end
MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
MOI.optimize!(model)
if presolving == 0
if presolving == 1 && v"8.0.1" <= SCIP.SCIP_versionnumber() <= v"8.0.2"
@test_broken MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test_broken MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
else
@info "presolving $presolving"
@info "$(SCIP.SCIP_versionnumber())"
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
@test (MOI.get(model, MOI.ObjectiveValue()), T(115 // 4), config)
@test (MOI.get(model, MOI.VariablePrimal(), x1), T(5 // 4), config)
@test (MOI.get(model, MOI.VariablePrimal(), x2), T(35 // 4), config)
@test (MOI.get(model, MOI.VariablePrimal(), z1), T(1), config)
@test (MOI.get(model, MOI.VariablePrimal(), z2), T(1), config)
else
@test_broken MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test_broken MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ end

@show(@eval(SCIP, libscip) == SCIP_jll.libscip)
@show(SCIP_PaPILO_jll.is_available() && @eval(SCIP, libscip) == SCIP_PaPILO_jll.libscip)
@show SCIP.SCIP_versionnumber()

@testset "MathOptInterface nonlinear expressions" begin
include("MOI_nonlinear_exprs.jl")
Expand Down

0 comments on commit d451668

Please sign in to comment.