Skip to content

Commit f8679be

Browse files
committed
test: addedSimModel no-allocations tests
1 parent ae86dbe commit f8679be

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/1_test_sim_model.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,10 @@ end
378378
end
379379
nonlinmodel4 = NonLinModel(f3!, h3!, Ts, 1, 1, 1, 1, solver=nothing)
380380
linmodel4 = linearize(nonlinmodel4; x, u, d)
381-
linearize!(linmodel4, nonlinmodel4)
382-
#@test @allocations(linearize!(linmodel4, nonlinmodel4)) == 0
381+
# see this bug : https://github.com/JuliaLang/julia/issues/51112
382+
linearize2!(linmodel, model) = (linearize!(linmodel, model); nothing)
383+
linearize2!(linmodel4, nonlinmodel4)
384+
@test @allocations(linearize2!(linmodel4, nonlinmodel4)) == 0
383385
end
384386

385387
@testitem "NonLinModel real time simulations" setup=[SetupMPCtests] begin

0 commit comments

Comments
 (0)