Skip to content

Commit e51754f

Browse files
authored
[Test] change MOI.OPTIMAL to config.optimal_status (#1434)
1 parent ed2606e commit e51754f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/Test/Test.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ _supports(config::Config, T::Any)::Bool = !(T in config.exclude)
294294
295295
Solve, and then test, various aspects of a model.
296296
297-
First, check that `TerminationStatus == MOI.OPTIMAL`.
297+
First, check that `TerminationStatus == config.optimal_status`.
298298
299299
If `objective_value` is not nothing, check that the attribute `ObjectiveValue()`
300300
is approximately `objective_value`.

src/Test/test_linear.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,7 @@ function test_linear_Indicator_integration(model::MOI.ModelLike, config::Config)
35543554
if _supports(config, MOI.optimize!)
35553555
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
35563556
MOI.optimize!(model)
3557-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
3557+
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
35583558
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
35593559
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.75, config)
35603560
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 1.25, config)
@@ -3647,7 +3647,7 @@ function test_linear_Indicator_ON_ONE(model::MOI.ModelLike, config::Config)
36473647
if _supports(config, MOI.optimize!)
36483648
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
36493649
MOI.optimize!(model)
3650-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
3650+
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
36513651
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
36523652
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.0, config)
36533653
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 2.0, config)
@@ -3762,7 +3762,7 @@ function test_linear_Indicator_ON_ZERO(model::MOI.ModelLike, config::Config)
37623762
if _supports(config, MOI.optimize!)
37633763
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
37643764
MOI.optimize!(model)
3765-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
3765+
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
37663766
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
37673767
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.75, config)
37683768
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 1.25, config)
@@ -3879,7 +3879,7 @@ function test_linear_Indicator_constant_term(
38793879
if _supports(config, MOI.optimize!)
38803880
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
38813881
MOI.optimize!(model)
3882-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
3882+
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
38833883
@test MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT
38843884
@test isapprox(MOI.get(model, MOI.ObjectiveValue()), 28.75, config)
38853885
@test isapprox(MOI.get(model, MOI.VariablePrimal(), x1), 1.25, config)

src/Test/test_objective.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function test_objective_ObjectiveFunction_blank(
145145
f = MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(0.0, x)], 0.0)
146146
MOI.set(model, obj_attr, f)
147147
MOI.optimize!(model)
148-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
148+
@test MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
149149
@test MOI.get(model, MOI.ObjectiveValue()) == 0.0
150150
return
151151
end

src/Test/test_solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ function test_solve_optimize_twice(
889889
)
890890
MOI.optimize!(model)
891891
MOI.optimize!(model)
892-
MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMAL
892+
MOI.get(model, MOI.TerminationStatus()) == config.optimal_status
893893
MOI.get(model, MOI.VariablePrimal(), x) == one(T)
894894
return
895895
end

0 commit comments

Comments
 (0)