Test Process function 1D array
(self)
| 24 | |
| 25 | # Test the (type* INPLACE_ARRAY_FLAT, int DIM_FLAT) typemap |
| 26 | def testProcess1D(self): |
| 27 | "Test Process function 1D array" |
| 28 | print(self.typeStr, "... ", end=' ', file=sys.stderr) |
| 29 | process = Flat.__dict__[self.typeStr + "Process"] |
| 30 | pack_output = b'' |
| 31 | for i in range(10): |
| 32 | pack_output += struct.pack(self.typeCode, i) |
| 33 | x = np.frombuffer(pack_output, dtype=self.typeCode) |
| 34 | y = x.copy() |
| 35 | process(y) |
| 36 | self.assertEqual(np.all((x + 1) == y), True) |
| 37 | |
| 38 | def testProcess3D(self): |
| 39 | "Test Process function 3D array" |