-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alseïdon
committed
Jul 10, 2024
1 parent
da25320
commit b8af28f
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Results of C compilation | ||
*.o | ||
lib.so | ||
lib.so | ||
|
||
|
||
# Test artifacts | ||
test/*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@testset "Integration tests" begin | ||
#= DEFAULT MODELS =# | ||
gen = TaylorGenerator("sincos", "sincos.eqs", ".") | ||
generate_dir(gen) | ||
han = get_handler(gen, true) | ||
|
||
function flow(x, t, han) | ||
y = similar(x) | ||
ccall(han.symbols["flow"], Cint, (Cdouble, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cvoid}), | ||
t, x, y, Ref(nothing) | ||
) | ||
return y | ||
end | ||
|
||
x = [1., 0.] | ||
ts = LinRange(0., 2π, 101) | ||
ys = map(t->flow(x, t, han), ts) | ||
y1 = map(i->i[1], ys) | ||
y2 = map(i->i[2], ys) | ||
|
||
@test y1 ≈ cos.(ts) | ||
@test y2 ≈ -sin.(ts) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
diff(x, t) = y; | ||
diff(y, t) = -x; |