Skip to content

Commit

Permalink
Add some simple tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmaostc committed Feb 12, 2024
1 parent 8342ecc commit 9ebbbf4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ using Zygote
@test radon(x, [0, π / 2, π, (3 / 2) * π, 2π]) [0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 1.0 1.0 1.0 1.0 1.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0]
x = zeros((7,7)); x[4,3] = 1
@test radon(x, [0, π / 2, π, (3 / 2) * π, 2π]) [0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 1.0 0.0 0.0 0.0 1.0; 0.0 1.0 0.0 1.0 0.0; 0.0 0.0 1.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0; 0.0 0.0 0.0 0.0 0.0]

x = zeros((5,5));x[3,3] = 1
@test radon(x, [0], geometry = RadonParallelCircle(5, (-1:0.25:1) .- 0.1)) [0.0; 0.0; 0.0; 1.0; 1.0; 1.0; 1.0; 0.0; 0.0;;]
@test radon(x, [0], geometry = RadonParallelCircle(5, (-1:0.25:1) .+ 0.1)) [0.0; 0.0; 1.0; 1.0; 1.0; 1.0; 0.0; 0.0; 0.0;;]
@test radon(x, [0], geometry = RadonParallelCircle(5, [0.499])) == [1.0;;]
@test radon(x, [0], geometry = RadonParallelCircle(5, [-0.499])) == [1.0;;]
@test radon(x, [0], geometry = RadonParallelCircle(5, [-0.5001])) == [0.0;;]
@test radon(x, [0], geometry = RadonParallelCircle(5, [+0.5001])) == [0.0;;]
end

@testset "Simple backproject test" begin
Expand Down

0 comments on commit 9ebbbf4

Please sign in to comment.