Skip to content

Commit 26ea446

Browse files
authored
[Test] add a test for empty conic problem (#1782)
1 parent 9cdacc8 commit 26ea446

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

src/Test/test_conic.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6791,3 +6791,37 @@ function setup_test(
67916791
)
67926792
return
67936793
end
6794+
6795+
function test_conic_empty_matrix(
6796+
model::MOI.ModelLike,
6797+
config::Config{T},
6798+
) where {T}
6799+
@requires _supports(config, MOI.optimize!)
6800+
F = MOI.VectorAffineFunction{T}
6801+
@requires MOI.supports_constraint(model, F, MOI.SecondOrderCone)
6802+
terms = MOI.VectorAffineTerm{T}[]
6803+
MOI.add_constraint(
6804+
model,
6805+
MOI.VectorAffineFunction(terms, [T(2), T(1), T(1)]),
6806+
MOI.SecondOrderCone(3),
6807+
)
6808+
MOI.optimize!(model)
6809+
status = MOI.get(model, MOI.TerminationStatus())
6810+
@test status in (config.optimal_status, MOI.INVALID_MODEL)
6811+
return
6812+
end
6813+
6814+
version_added(::typeof(test_conic_empty_matrix)) = v"1.1.1"
6815+
6816+
function setup_test(
6817+
::typeof(test_conic_empty_matrix),
6818+
model::MOIU.MockOptimizer,
6819+
::Config{T},
6820+
) where {T}
6821+
MOIU.set_mock_optimize!(
6822+
model,
6823+
(mock::MOIU.MockOptimizer) ->
6824+
MOIU.mock_optimize!(mock, MOI.INVALID_MODEL),
6825+
)
6826+
return
6827+
end

0 commit comments

Comments
 (0)