summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/swig/test/Array.i5
-rw-r--r--doc/swig/test/Array2.h2
-rwxr-xr-xdoc/swig/test/testArray.py12
3 files changed, 7 insertions, 12 deletions
diff --git a/doc/swig/test/Array.i b/doc/swig/test/Array.i
index d56dd2d1c..6a8605eb6 100644
--- a/doc/swig/test/Array.i
+++ b/doc/swig/test/Array.i
@@ -50,11 +50,6 @@
{(int nrows, int ncols, long* data )};
%apply (int* DIM1 , int* DIM2 , long** ARGOUTVIEW_ARRAY2)
{(int* nrows, int* ncols, long** data )};
-// Note: the %apply for INPLACE_ARRAY2 above gets successfully applied
-// to the constructor Array2(int nrows, int ncols, long* data), but
-// does not get applied to the method Array2::resize(int nrows, int
-// ncols, long* data). I have no idea why. For this reason the test
-// for Apply2.resize(numpy.ndarray) in testArray.py is commented out.
// Array1 support
%include "Array1.h"
diff --git a/doc/swig/test/Array2.h b/doc/swig/test/Array2.h
index a6e5bfc30..7f8d4ca65 100644
--- a/doc/swig/test/Array2.h
+++ b/doc/swig/test/Array2.h
@@ -32,7 +32,7 @@ public:
int ncols() const;
// Resize array
- void resize(int ncols, int nrows, long* data=0);
+ void resize(int nrows, int ncols, long* data=0);
// Set item accessor
Array1 & operator[](int i);
diff --git a/doc/swig/test/testArray.py b/doc/swig/test/testArray.py
index b25aff85a..65e69e191 100755
--- a/doc/swig/test/testArray.py
+++ b/doc/swig/test/testArray.py
@@ -69,7 +69,7 @@ class Array1TestCase(unittest.TestCase):
"Test Array1 resize method, array"
a = np.zeros((2*self.length,), dtype='l')
self.array1.resize(a)
- self.failUnless(len(self.array1) == len(a))
+ self.failUnless(len(self.array1) == a.size)
def testResizeBad(self):
"Test Array1 resize method, negative length"
@@ -177,11 +177,11 @@ class Array2TestCase(unittest.TestCase):
self.array2.resize(newRows, newCols)
self.failUnless(len(self.array2) == newRows * newCols)
- #def testResize1(self):
- # "Test Array2 resize method, array"
- # a = np.zeros((2*self.nrows, 2*self.ncols), dtype='l')
- # self.array2.resize(a)
- # self.failUnless(len(self.array2) == len(a))
+ def testResize1(self):
+ "Test Array2 resize method, array"
+ a = np.zeros((2*self.nrows, 2*self.ncols), dtype='l')
+ self.array2.resize(a)
+ self.failUnless(len(self.array2) == a.size)
def testResizeBad1(self):
"Test Array2 resize method, negative nrows"