Skip to content

Bridges throw wrong errors during modification #1603

Closed
@odow

Description

@odow

Found during jump-dev/SCS.jl#219

optimizer = SCS.Optimizer()
MOI.set(optimizer, MOI.Silent(), true)
model = MOI.Bridges.full_bridge_optimizer(
    MOI.Utilities.CachingOptimizer(
        MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()),
        optimizer,
    ),
    Float64,
)
julia> MOI.Test.test_modification_set_function_single_variable(model, MOI.Test.Config())
Test Failed at /Users/oscar/.julia/dev/MathOptInterface/src/Test/test_modification.jl:29
  Expression: MOI.set(model, MOI.ConstraintFunction(), c, y)
    Expected: MathOptInterface.SettingVariableIndexNotAllowed()
      Thrown: MathOptInterface.SetAttributeNotAllowed{MathOptInterface.ConstraintFunction}(MathOptInterface.ConstraintFunction(), "")
ERROR: There was an error during testing
optimizer = SCS.Optimizer()
MOI.set(optimizer, MOI.Silent(), true)
model = MOI.Bridges.full_bridge_optimizer(
    MOI.Utilities.CachingOptimizer(
        MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()),
        optimizer,
    ),
    Float64,
)
julia> MOI.Test.test_objective_incorrect_modifications(model, MOI.Test.Config())
Test Failed at /Users/oscar/.julia/dev/MathOptInterface/src/Test/test_objective.jl:539
  Expression: MOI.set(model, MOI.ConstraintSet(), c, MOI.LessThan(1.0))
    Expected: ArgumentError
  No exception thrown
ERROR: There was an error during testing

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions