Skip to content

Commit 597f5aa

Browse files
authored
[Test] add require for ListOfModelAttributesSet in tests (#2196)
1 parent d122068 commit 597f5aa

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Test/test_objective.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ function test_objective_set_via_modify(
527527
@requires MOI.supports(model, attr)
528528
@requires _supports(config, MOI.modify)
529529
@requires _supports(config, MOI.ScalarCoefficientChange)
530+
@requires _supports(config, MOI.ListOfModelAttributesSet)
530531
@test MOI.get(model, MOI.ListOfModelAttributesSet()) == []
531532
x = MOI.add_variable(model)
532533
MOI.modify(model, attr, MOI.ScalarCoefficientChange(x, T(1)))
@@ -536,10 +537,11 @@ end
536537

537538
function test_objective_ObjectiveSense_in_ListOfModelAttributesSet(
538539
model::MOI.ModelLike,
539-
::Config{T},
540+
config::Config{T},
540541
) where {T}
541542
attr = MOI.ObjectiveSense()
542543
@requires MOI.supports(model, attr)
544+
@requires _supports(config, MOI.ListOfModelAttributesSet)
543545
@test (attr in MOI.get(model, MOI.ListOfModelAttributesSet())) == false
544546
MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
545547
@test (attr in MOI.get(model, MOI.ListOfModelAttributesSet())) == true
@@ -548,10 +550,11 @@ end
548550

549551
function test_objective_VariableIndex_in_ListOfModelAttributesSet(
550552
model::MOI.ModelLike,
551-
::Config{T},
553+
config::Config{T},
552554
) where {T}
553555
attr = MOI.ObjectiveFunction{MOI.VariableIndex}()
554556
@requires MOI.supports(model, attr)
557+
@requires _supports(config, MOI.ListOfModelAttributesSet)
555558
@test (attr in MOI.get(model, MOI.ListOfModelAttributesSet())) == false
556559
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
557560
x = MOI.add_variable(model)
@@ -562,10 +565,11 @@ end
562565

563566
function test_objective_ScalarAffineFunction_in_ListOfModelAttributesSet(
564567
model::MOI.ModelLike,
565-
::Config{T},
568+
config::Config{T},
566569
) where {T}
567570
attr = MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}()
568571
@requires MOI.supports(model, attr)
572+
@requires _supports(config, MOI.ListOfModelAttributesSet)
569573
@test (attr in MOI.get(model, MOI.ListOfModelAttributesSet())) == false
570574
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
571575
x = MOI.add_variable(model)
@@ -576,10 +580,11 @@ end
576580

577581
function test_objective_ScalarQuadraticFunction_in_ListOfModelAttributesSet(
578582
model::MOI.ModelLike,
579-
::Config{T},
583+
config::Config{T},
580584
) where {T}
581585
attr = MOI.ObjectiveFunction{MOI.ScalarQuadraticFunction{T}}()
582586
@requires MOI.supports(model, attr)
587+
@requires _supports(config, MOI.ListOfModelAttributesSet)
583588
@test (attr in MOI.get(model, MOI.ListOfModelAttributesSet())) == false
584589
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
585590
x = MOI.add_variable(model)

0 commit comments

Comments
 (0)