Test ones function
(self)
| 154 | |
| 155 | # Test the (type* INPLACE_ARRAY1, int DIM1) typemap |
| 156 | def testOnes(self): |
| 157 | "Test ones function" |
| 158 | print(self.typeStr, "... ", end=' ', file=sys.stderr) |
| 159 | ones = Vector.__dict__[self.typeStr + "Ones"] |
| 160 | vector = np.zeros(5, self.typeCode) |
| 161 | ones(vector) |
| 162 | np.testing.assert_array_equal(vector, np.array([1, 1, 1, 1, 1])) |
| 163 | |
| 164 | # Test the (type* INPLACE_ARRAY1, int DIM1) typemap |
| 165 | def testOnesWrongDim(self): |