Beispiel #1
0
 def testNotContiguous(self):
     sbuf = numpy.ones([3,2])[:,0]
     rbuf = numpy.zeros([3])
     self.assertRaises(
         (BufferError, ValueError, TypeError),
         Sendrecv, sbuf, rbuf,
     )
Beispiel #2
0
 def testNotWriteable(self):
     sbuf = numpy.ones([3])
     rbuf = numpy.zeros([3])
     rbuf.flags.writeable = False
     self.assertRaises(
         (BufferError, ValueError, TypeError),
         Sendrecv, sbuf, rbuf
     )
Beispiel #3
0
 def testOrderFortran(self):
     sbuf = numpy.ones([3,2]).T
     rbuf = numpy.zeros([3,2]).T
     Sendrecv(sbuf, rbuf)
     self.assertTrue((sbuf == rbuf).all())
Beispiel #4
0
 def testReadonly(self):
     sbuf = numpy.ones([3])
     rbuf = numpy.zeros([3])
     sbuf.flags.writeable = False
     Sendrecv(sbuf, rbuf)
     self.assertTrue((sbuf == rbuf).all())
Beispiel #5
0
 def testOrderC(self):
     sbuf = numpy.ones([3,2])
     rbuf = numpy.zeros([3,2])
     Sendrecv(sbuf, rbuf)
     self.assertTrue((sbuf == rbuf).all())