Skip to content

Commit 05a2e51

Browse files
committed
Add tests
1 parent 378aaef commit 05a2e51

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/utils.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ end
2929
# supports_autoenzyme(::Type{<:Any})
3030
@test MeshIntegrals.supports_autoenzyme(Nothing) == false
3131

32+
# Check currency of supports_autoenzyme status
33+
curve = BezierCurve([Point(t, 0) for t in range(-π, π, length = 361)])
34+
@test_throws "proven readonly" jacobian(curve, (0.5,), AutoEnzyme())
35+
cyl = Cylinder(Point(0, 0, 0), Point(0, 0, 1), 2.0)
36+
@test_throws "jl_get_builtin_fptr" jacobian(cyl, (0.5, 0.5, 0.5), AutoEnzyme())
37+
cylsurf = CylinderSurface(Point(0, 0, 0), Point(0, 0, 1), 2.0)
38+
@test_throws "jl_get_builtin_fptr" jacobian(cylsurf, (0.5, 0.5), AutoEnzyme())
39+
3240
# _default_diff_method -- using type or instance, Enzyme-supported combination
3341
let sphere = Sphere(Point(0, 0, 0), 1.0)
3442
@test _default_diff_method(Meshes.Sphere, Float64) isa AutoEnzyme
@@ -56,10 +64,6 @@ end
5664
box = Box(Point(0, 0), Point(1, 1))
5765
@test_throws ArgumentError jacobian(box, zeros(3), FiniteDifference())
5866
@test_throws ArgumentError jacobian(box, zeros(3), AutoEnzyme())
59-
60-
# Check currency of supports_autoenzyme status
61-
curve = BezierCurve([Point(t, 0) for t in range(-π, π, length = 361)])
62-
@test_throws "readonly" MeshIntegrals.jacobian(curve, (0.5,), AutoEnzyme())
6367
end
6468

6569
@testitem "_ParametricGeometry" setup=[Utils] begin

0 commit comments

Comments
 (0)