Skip to content

Commit c5c3755

Browse files
author
Gaurav Arya
committed
more tests
1 parent 3b2a754 commit c5c3755

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/runtests.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,12 @@ end
238238
for dims in unique((1, 1:N, N))
239239
P = plan_fft(x, dims)
240240
@test (P')' * x == P * x # test adjoint of adjoint
241-
@test dot(y, P * x) dot(P' * y, x)
241+
@test size(P') == AbstractFFTs.output_size(P) # test size of adjoint
242+
@test dot(y, P * x) dot(P' * y, x) # test validity of adjoint
242243
@test_broken dot(y, P \ x) dot(P' \ y, x)
243244
Pinv = plan_ifft(y)
244-
@test (Pinv')' * y == Pinv * y # test adjoint of adjoint
245+
@test (Pinv')' * y == Pinv * y
246+
@test size(Pinv') == AbstractFFTs.output_size(Pinv)
245247
@test dot(x, Pinv * y) dot(Pinv' * x, y)
246248
@test_broken dot(x, Pinv \ y) dot(Pinv' \ x, y)
247249
end
@@ -252,14 +254,16 @@ end
252254
N = ndims(x)
253255
for dims in unique((1, 1:N, N))
254256
P = plan_rfft(x, dims)
255-
@test (P')' * x == P * x
256257
y_real = randn(size(P * x))
257258
y_imag = randn(size(P * x))
258259
y = y_real .+ y_imag .* im
260+
@test (P')' * x == P * x
261+
@test size(P') == AbstractFFTs.output_size(P)
259262
@test dot(y_real, real.(P * x)) + dot(y_imag, imag.(P * x)) dot(P' * y, x)
260263
@test_broken dot(y_real, real.(P \ x)) + dot(y_imag, imag.(P \ x)) dot(P' * y, x)
261264
Pinv = plan_irfft(y, size(x)[first(dims)], dims)
262265
@test (Pinv')' * y == Pinv * y
266+
@test size(Pinv') == AbstractFFTs.output_size(Pinv)
263267
@test dot(x, Pinv * y) dot(y_real, real.(Pinv' * x)) + dot(y_imag, imag.(Pinv' * x))
264268
@test_broken dot(x, Pinv \ y) dot(y_real, real.(Pinv' \ x)) + dot(y_imag, imag.(Pinv' \ x))
265269
end

0 commit comments

Comments
 (0)