# [Scipy-svn] r4911 - trunk/scipy/fftpack/tests

scipy-svn@scip... scipy-svn@scip...
Sun Nov 2 02:54:10 CST 2008

```Author: cdavid
Date: 2008-11-02 02:54:02 -0600 (Sun, 02 Nov 2008)
New Revision: 4911

Modified:
trunk/scipy/fftpack/tests/test_basic.py
Log:
BUG: Add regression test for #244 proper.

Modified: trunk/scipy/fftpack/tests/test_basic.py
===================================================================
--- trunk/scipy/fftpack/tests/test_basic.py	2008-11-02 08:53:46 UTC (rev 4910)
+++ trunk/scipy/fftpack/tests/test_basic.py	2008-11-02 08:54:02 UTC (rev 4911)
@@ -12,7 +12,7 @@
"""

from numpy.testing import *
-from scipy.fftpack import ifft,fft,fftn,ifftn,rfft,irfft
+from scipy.fftpack import ifft,fft,fftn,ifftn,rfft,irfft, fft2
from scipy.fftpack import _fftpack as fftpack

from numpy import arange, add, array, asarray, zeros, dot, exp, pi,\
@@ -230,6 +230,15 @@
assert_array_almost_equal (irfft(rfft(x)),x)
assert_array_almost_equal (rfft(irfft(x)),x)

+class Testfft2(TestCase):
+    def test_regression_244(self):
+        """fft returns wrong result with axes parameter."""
+        # fftn (and hence fft2) used to break when both axes and shape were
+        # used
+        x = numpy.ones((4,4,2))
+        y = fft2(x, shape=(8,8), axes=(-3,-2))
+        y_r = numpy.fft.fftn(x, s=(8, 8), axes=(-3,  -2))
+        assert_array_almost_equal(y, y_r)

class TestFftn(TestCase):

```