Skip to content

Commit f31ce98

Browse files
committed
Add a test
1 parent e2f4799 commit f31ce98

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/build_function.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ h_str = ModelingToolkit.build_function(h, [a], [b], [c1, c2, c3], [d], [e], [g])
1616
h_oop = eval(h_str[1])
1717
h_ip! = eval(h_str[2])
1818
h_ip_skip! = eval(ModelingToolkit.build_function(h, [a], [b], [c1, c2, c3], [d], [e], [g], skipzeros=true, fillzeros=false)[2])
19+
h_ip_skip_par! = eval(ModelingToolkit.build_function(h, [a], [b], [c1, c2, c3], [d], [e], [g], skipzeros=true, parallel=ModelingToolkit.MultithreadedForm(), fillzeros=false)[2])
1920
inputs = ([1], [2], [3, 4, 5], [6], [7], [8])
2021

2122
@test h_oop(inputs...) == h_julia(inputs...)
@@ -30,6 +31,12 @@ h_ip_skip!(out_1, inputs...)
3031
out_1[3] = 0
3132
@test out_1 == out_2
3233

34+
fill!(out_1, 10)
35+
h_ip_skip_par!(out_1, inputs...)
36+
@test out_1[3] == 10
37+
out_1[3] = 0
38+
@test out_1 == out_2
39+
3340
# Multiple input matrix, some unused arguments
3441
h_skip = [a + b + c1; c2 + c3 + g] # skip d, e
3542
h_julia_skip(a, b, c, d, e, g) = [a[1] + b[1] + c[1]; c[2] + c[3] + g[1]]

0 commit comments

Comments
 (0)