Skip to content

Commit acdb209

Browse files
committed
Fix r2r2r_identity test
Reusing a plan for different arrays than it was created with requires that they have the same size and alignment as was used for creating the plan. By assigning an entirely new vec to `a` - which may have a different alignment - this test currently violating that requirement. Fix this by filling the existing vec instead of allocating a new one
1 parent b376198 commit acdb209

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fftw/tests/r2r.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ fn r2r2r_identity() {
2525
let factor = 2. * n as f64;
2626

2727
// Vector of ones.
28-
a = vec![1.0f64; n];
28+
for a_i in a.iter_mut() {
29+
*a_i = 1.0;
30+
}
2931

3032
// Forward pass.
3133
fwd.r2r(&mut a, &mut b).unwrap();

0 commit comments

Comments
 (0)