Skip to content

Commit

Permalink
Explicit tests for MOI.TerminationStatus with infeasible statuses. (#409
Browse files Browse the repository at this point in the history
)

This ensures that an issue like https://github.com/jump-dev/CPLEX.jl/pull/366/files doesn't sneak in.
  • Loading branch information
dourouc05 authored May 13, 2021
1 parent ecffeed commit ff9eab3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/MOI/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ function test_Conflict_refiner_bound_bound()

# Once it's called, no problem.
MOI.compute_conflict!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.INFEASIBLE
@test MOI.get(model, Gurobi.ConflictStatus()) == 0
@test MOI.get(model, MOI.ConflictStatus()) == MOI.CONFLICT_FOUND
@test MOI.get(model, MOI.ConstraintConflictStatus(), c1) == MOI.IN_CONFLICT
Expand All @@ -322,6 +323,7 @@ function test_Conflict_refiner_bound_affine()

# Once it's called, no problem.
MOI.compute_conflict!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.INFEASIBLE
@test MOI.get(model, Gurobi.ConflictStatus()) == 0
@test MOI.get(model, MOI.ConflictStatus()) == MOI.CONFLICT_FOUND
@test MOI.get(model, MOI.ConstraintConflictStatus(), c1) == MOI.IN_CONFLICT
Expand All @@ -342,6 +344,7 @@ function test_Conflict_refiner_invalid_interval()

# Once it's called, no problem.
MOI.compute_conflict!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.INFEASIBLE
@test MOI.get(model, Gurobi.ConflictStatus()) == 0
@test MOI.get(model, MOI.ConflictStatus()) == MOI.CONFLICT_FOUND
@test MOI.get(model, MOI.ConstraintConflictStatus(), c1) == MOI.IN_CONFLICT
Expand All @@ -366,6 +369,7 @@ function test_Conflict_refiner_affine_affine()

# Once it's called, no problem.
MOI.compute_conflict!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.INFEASIBLE
@test MOI.get(model, Gurobi.ConflictStatus()) == 0
@test MOI.get(model, MOI.ConflictStatus()) == MOI.CONFLICT_FOUND
@test MOI.get(model, MOI.ConstraintConflictStatus(), b1) == MOI.IN_CONFLICT
Expand Down Expand Up @@ -393,6 +397,7 @@ function test_Conflict_refiner_equalto()

# Once it's called, no problem.
MOI.compute_conflict!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.INFEASIBLE
@test MOI.get(model, Gurobi.ConflictStatus()) == 0
@test MOI.get(model, MOI.ConflictStatus()) == MOI.CONFLICT_FOUND
@test MOI.get(model, MOI.ConstraintConflictStatus(), b1) == MOI.IN_CONFLICT
Expand Down Expand Up @@ -422,6 +427,7 @@ function test_Conflict_refiner_outside_conflict()

# Once it's called, no problem.
MOI.compute_conflict!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.INFEASIBLE
@test MOI.get(model, Gurobi.ConflictStatus()) == 0
@test MOI.get(model, MOI.ConflictStatus()) == MOI.CONFLICT_FOUND
@test MOI.get(model, MOI.ConstraintConflictStatus(), b1) == MOI.IN_CONFLICT
Expand Down

0 comments on commit ff9eab3

Please sign in to comment.