Skip to content

Commit 561317b

Browse files
authored
[Test] allow NORM_LIMIT in unbounded tests (#1990)
1 parent bbdf078 commit 561317b

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/Test/test_linear.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,9 +1432,11 @@ function test_linear_DUAL_INFEASIBLE(
14321432
if _supports(config, MOI.optimize!)
14331433
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
14341434
MOI.optimize!(model)
1435-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.DUAL_INFEASIBLE ||
1436-
MOI.get(model, MOI.TerminationStatus()) ==
1437-
MOI.INFEASIBLE_OR_UNBOUNDED
1435+
status = MOI.get(model, MOI.TerminationStatus())
1436+
@test in(
1437+
status,
1438+
(MOI.DUAL_INFEASIBLE, MOI.NORM_LIMIT, MOI.INFEASIBLE_OR_UNBOUNDED),
1439+
)
14381440
if MOI.get(model, MOI.PrimalStatus()) == MOI.INFEASIBILITY_CERTIFICATE
14391441
# solver returned an unbounded ray
14401442
@test MOI.get(model, MOI.ResultCount()) >= 1
@@ -1517,9 +1519,11 @@ function test_linear_DUAL_INFEASIBLE_2(
15171519
if _supports(config, MOI.optimize!)
15181520
@test MOI.get(model, MOI.TerminationStatus()) == MOI.OPTIMIZE_NOT_CALLED
15191521
MOI.optimize!(model)
1520-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.DUAL_INFEASIBLE ||
1521-
MOI.get(model, MOI.TerminationStatus()) ==
1522-
MOI.INFEASIBLE_OR_UNBOUNDED
1522+
status = MOI.get(model, MOI.TerminationStatus())
1523+
@test in(
1524+
status,
1525+
(MOI.DUAL_INFEASIBLE, MOI.NORM_LIMIT, MOI.INFEASIBLE_OR_UNBOUNDED),
1526+
)
15231527
if MOI.get(model, MOI.PrimalStatus()) == MOI.INFEASIBILITY_CERTIFICATE
15241528
# solver returned an unbounded ray
15251529
@test MOI.get(model, MOI.ResultCount()) >= 1

src/Test/test_solve.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ function test_solve_TerminationStatus_DUAL_INFEASIBLE(
210210
)
211211
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
212212
MOI.optimize!(model)
213-
@test MOI.get(model, MOI.TerminationStatus()) == MOI.DUAL_INFEASIBLE
213+
status = MOI.get(model, MOI.TerminationStatus())
214+
@test in(
215+
status,
216+
(MOI.DUAL_INFEASIBLE, MOI.NORM_LIMIT, MOI.INFEASIBLE_OR_UNBOUNDED),
217+
)
214218
return
215219
end
216220

0 commit comments

Comments
 (0)