Skip to content

Commit f3a843f

Browse files
committed
Document test_wrappers
1 parent 22dc932 commit f3a843f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: src/TestUtils.jl

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module TestUtils
22

33
"""
4-
TestUtils.test_complex_ffts(ArrayType=Array; test_inplace=true, test_adjoint=true)
4+
TestUtils.test_complex_ffts(ArrayType=Array; test_inplace=true, test_adjoint=true, test_wrappers=true)
55
66
Run tests to verify correctness of FFT, BFFT, and IFFT functionality using a particular backend plan implementation.
77
The backend implementation is assumed to be loaded prior to calling this function.
@@ -13,11 +13,12 @@ The backend implementation is assumed to be loaded prior to calling this functio
1313
`convert(ArrayType, ...)`.
1414
- `test_inplace=true`: whether to test in-place plans.
1515
- `test_adjoint=true`: whether to test [plan adjoints](api.md#Base.adjoint).
16+
- `test_wrappers=true`: whether to test any wrapper array inputs such as views.
1617
"""
1718
function test_complex_ffts end
1819

1920
"""
20-
TestUtils.test_real_ffts(ArrayType=Array; test_adjoint=true, copy_input=false)
21+
TestUtils.test_real_ffts(ArrayType=Array; test_adjoint=true, copy_input=false, test_wrappers=true)
2122
2223
Run tests to verify correctness of RFFT, BRFFT, and IRFFT functionality using a particular backend plan implementation.
2324
The backend implementation is assumed to be loaded prior to calling this function.
@@ -30,18 +31,21 @@ The backend implementation is assumed to be loaded prior to calling this functio
3031
- `test_adjoint=true`: whether to test [plan adjoints](api.md#Base.adjoint).
3132
- `copy_input=false`: whether to copy the input before applying the plan in tests, to accomodate for
3233
[input-mutating behaviour of real FFTW plans](https://github.com/JuliaMath/AbstractFFTs.jl/issues/101).
34+
- `test_wrappers=true`: whether to test any wrapper array inputs such as views.
3335
"""
3436
function test_real_ffts end
3537

3638
# Always copy input before application due to FFTW real plans possibly mutating input (AbstractFFTs.jl#101)
3739
"""
3840
TestUtils.test_plan(P::Plan, x::AbstractArray, x_transformed::AbstractArray;
39-
inplace_plan=false, copy_input=false)
41+
inplace_plan=false, copy_input=false, test_wrappers=true)
4042
4143
Test basic properties of a plan `P` given an input array `x` and expected output `x_transformed`.
4244
4345
Because [real FFTW plans may mutate their input in some cases](https://github.com/JuliaMath/AbstractFFTs.jl/issues/101),
4446
we allow specifying `copy_input=true` to allow for this behaviour in tests by copying the input before applying the plan.
47+
We also allow specifying `test_wrappers=false` to skip testing wrapper array inputs such as views, which may cause ambiguity
48+
issues for some array types currently.
4549
"""
4650
function test_plan end
4751

@@ -55,6 +59,8 @@ Real-to-complex and complex-to-real plans require a slightly modified dot test,
5559
The plan is assumed out-of-place, as adjoints are not yet supported for in-place plans.
5660
Because [real FFTW plans may mutate their input in some cases](https://github.com/JuliaMath/AbstractFFTs.jl/issues/101),
5761
we allow specifying `copy_input=true` to allow for this behaviour in tests by copying the input before applying the plan.
62+
We also allow specifying `test_wrappers=false` to skip testing wrapper array inputs such as views, which may cause ambiguity
63+
issues for some array types currently.
5864
"""
5965
function test_plan_adjoint end
6066

0 commit comments

Comments
 (0)