Discussion:
[Python-3000-checkins] r66382 - python/branches/py3k/Lib/ctypes/test/test_pep3118.py
amaury.forgeotdarc
2008-09-11 00:26:17 UTC
Permalink
Author: amaury.forgeotdarc
Date: Thu Sep 11 02:26:17 2008
New Revision: 66382

Log:
Correct a test_ctypes failure, caused by the removal of memoryview.size.


Modified:
python/branches/py3k/Lib/ctypes/test/test_pep3118.py

Modified: python/branches/py3k/Lib/ctypes/test/test_pep3118.py
==============================================================================
--- python/branches/py3k/Lib/ctypes/test/test_pep3118.py (original)
+++ python/branches/py3k/Lib/ctypes/test/test_pep3118.py Thu Sep 11 02:26:17 2008
@@ -25,7 +25,7 @@
v = memoryview(ob)
try:
self.failUnlessEqual(normalize(v.format), normalize(fmt))
- self.failUnlessEqual(v.size, sizeof(ob))
+ self.failUnlessEqual(len(v), sizeof(ob))
self.failUnlessEqual(v.itemsize, sizeof(itemtp))
self.failUnlessEqual(v.shape, shape)
# ctypes object always have a non-strided memory block
@@ -37,7 +37,7 @@
n = 1
for dim in v.shape:
n = n * dim
- self.failUnlessEqual(v.itemsize * n, v.size)
+ self.failUnlessEqual(v.itemsize * n, len(v))
except:
# so that we can see the failing type
print(tp)
@@ -49,7 +49,7 @@
v = memoryview(ob)
try:
self.failUnlessEqual(v.format, fmt)
- self.failUnlessEqual(v.size, sizeof(ob))
+ self.failUnlessEqual(len(v), sizeof(ob))
self.failUnlessEqual(v.itemsize, sizeof(itemtp))
self.failUnlessEqual(v.shape, shape)
# ctypes object always have a non-strided memory block
@@ -61,7 +61,7 @@
n = 1
for dim in v.shape:
n = n * dim
- self.failUnlessEqual(v.itemsize * n, v.size)
+ self.failUnlessEqual(v.itemsize * n, len(v))
except:
# so that we can see the failing type
print(tp)

Loading...