diff --git a/test/C_API.jl b/test/C_API.jl index b633910..56eb5e1 100644 --- a/test/C_API.jl +++ b/test/C_API.jl @@ -561,7 +561,7 @@ end function test_copy_failure() opt = Opt(:LD_MMA, 2) - opt.opt = C_NULL + setfield!(opt, :opt, C_NULL) @test_throws ErrorException("Error in nlopt_copy") copy(opt) return end