Skip to content

Commit 456eb6c

Browse files
committed
test: improve coverage with SecondOrder backends
1 parent 71c9246 commit 456eb6c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/3_test_predictive_control.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,11 @@ end
730730
@test nmpc18.gradient == AutoFiniteDiff()
731731
@test nmpc18.jacobian == AutoFiniteDiff()
732732
@test nmpc18.hessian == AutoFiniteDiff()
733+
nmpc19 = NonLinMPC(nonlinmodel, Hc=1, Hp=10, Cwt=Inf,
734+
hessian=SecondOrder(AutoForwardDiff(), AutoForardDiff())
735+
)
736+
@test nmpc19.hessian == SecondOrder(AutoForwardDiff(), AutoForardDiff())
737+
@test_nowarn repr(nmpc19) # printing SecondOrder backends, for coverage
733738

734739
nonlinmodel2 = NonLinModel{Float32}(f, h, Ts, 2, 4, 2, 1, solver=nothing)
735740
nmpc15 = NonLinMPC(nonlinmodel2, Hp=15)

0 commit comments

Comments
 (0)