Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Test/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ _supports(config::Config, T::Any)::Bool = !(T in config.exclude)

Solve, and then test, various aspects of a model.

First, check that `TerminationStatus == MOI.OPTIMAL`.
First, check that `TerminationStatus == config.optimal_status`.

If `objective_value` is not nothing, check that the attribute `ObjectiveValue()`
is approximately `objective_value`.
Expand Down
8 changes: 4 additions & 4 deletions src/Test/test_linear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3554,7 +3554,7 @@ function test_linear_Indicator_integration(model::MOI.ModelLike, config::Config)
if _supports(config, MOI.optimize!)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
MOI.optimize!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.75, config)
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 1.25, config)
Expand Down Expand Up @@ -3647,7 +3647,7 @@ function test_linear_Indicator_ON_ONE(model::MOI.ModelLike, config::Config)
if _supports(config, MOI.optimize!)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
MOI.optimize!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.0, config)
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 2.0, config)
Expand Down Expand Up @@ -3762,7 +3762,7 @@ function test_linear_Indicator_ON_ZERO(model::MOI.ModelLike, config::Config)
if _supports(config, MOI.optimize!)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
MOI.optimize!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.75, config)
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 1.25, config)
Expand Down Expand Up @@ -3879,7 +3879,7 @@ function test_linear_Indicator_constant_term(
if _supports(config, MOI.optimize!)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
MOI.optimize!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.75, config)
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 1.25, config)
Expand Down
2 changes: 1 addition & 1 deletion src/Test/test_objective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function test_objective_ObjectiveFunction_blank(
f = MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(0.0, x)], 0.0)
MOI.set(model, obj_attr, f)
MOI.optimize!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
@test MOI.get(model, MOI.ObjectiveValue()) == 0.0
return
end
Expand Down
2 changes: 1 addition & 1 deletion src/Test/test_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ function test_solve_optimize_twice(
)
MOI.optimize!(model)
MOI.optimize!(model)
MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
MOI.get(model, MOI.VariablePrimal(), x) == one(T)
return
end
Expand Down