diff --git a/src/msk_functions.jl b/src/msk_functions.jl index e614e05..24522d0 100644 --- a/src/msk_functions.jl +++ b/src/msk_functions.jl @@ -8384,7 +8384,7 @@ removecones(task:: MSKtask,subset:: Vector{T1}) where {T1} = removecones(task,co function removecones(task_:: MSKtask,subset_:: Vector{Int32}) num_ = minimum([ length(subset_) ]) res = disable_sigint() do - @msk_ccall( "removecones",Int32,(Ptr{Nothing},Int32,Ptr{Int32},),task_.task,num_,subset_ .- Int32(1)) + @msk_ccall( "removecones",Int32,(Ptr{Nothing},Int32,Ptr{Int32},),task_.task,num_, subset_ .- Int32(1)) end if res != MSK_RES_OK.value msg = getlasterror(task_) diff --git a/test/apitest.jl b/test/apitest.jl index 3cc1e76..4388c84 100644 --- a/test/apitest.jl +++ b/test/apitest.jl @@ -294,6 +294,26 @@ function test_sdo1() end end +function test_removecones() + task = maketask() + appendvars(task, 7) + appendcone(task, MSK_CT_QUAD, 0.0, [1, 2, 3]) + appendcone(task, MSK_CT_RQUAD, 0.0, [4, 5, 6, 7]) + @test getcone(task, 1) == (Mosek.MSK_CT_QUAD, 0.0, 3, Int32[1, 2, 3]) + @test getconeinfo(task, 1) == (Mosek.MSK_CT_QUAD, 0.0, 3) + @test getcone(task, 2) == (Mosek.MSK_CT_RQUAD, 0.0, 4, Int32[4, 5, 6, 7]) + @test getconeinfo(task, 2) == (Mosek.MSK_CT_RQUAD, 0.0, 4) + removecones(task, [1]) + info = getconeinfo(task, 1) + # `info[1]` is Mosek.MSK_CT_QUAD + @test_broken info[1] == Mosek.MSK_CT_RQUAD + @test info[2:end] == (0.0, 4) + cone = getcone(task, 1) + # `cone[1]` is Mosek.MSK_CT_QUAD + @test_broken cone[1] == Mosek.MSK_CT_RQUAD + @test cone[2:end] == (0.0, 4, Int32[4, 5, 6, 7]) +end + @testset "[apitest]" begin @testset "lo1" begin test_lo1() @@ -319,5 +339,9 @@ end test_sdo1() end + @testset "removecones" begin + test_removecones() + end + end