[pypy-commit] pypy ffistruct: move this test at the end, after the ones which directly operate on StructDescr
antocuni
noreply at buildbot.pypy.org
Wed Nov 9 13:51:04 CET 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: ffistruct
Changeset: r48994:128dbcd93861
Date: 2011-11-08 10:46 +0100
http://bitbucket.org/pypy/pypy/changeset/128dbcd93861/
Log: move this test at the end, after the ones which directly operate on
StructDescr
diff --git a/pypy/module/_ffi/test/test_struct.py b/pypy/module/_ffi/test/test_struct.py
--- a/pypy/module/_ffi/test/test_struct.py
+++ b/pypy/module/_ffi/test/test_struct.py
@@ -27,22 +27,6 @@
assert descr.ffitype.sizeof() == longsize*2
assert descr.ffitype.name == 'struct foo'
- def test_compute_shape(self):
- from _ffi import Structure, Field, types
- class Point(Structure):
- _fields_ = [
- Field('x', types.slong),
- Field('y', types.slong),
- ]
-
- longsize = types.slong.sizeof()
- assert isinstance(Point.x, Field)
- assert isinstance(Point.y, Field)
- assert Point.x.offset == 0
- assert Point.y.offset == longsize
- assert Point._struct_.ffitype.sizeof() == longsize*2
- assert Point._struct_.ffitype.name == 'struct Point'
-
def test_getfield_setfield(self):
from _ffi import _StructDescr, Field, types
longsize = types.slong.sizeof()
@@ -70,3 +54,20 @@
struct = descr.allocate()
raises(AttributeError, "struct.getfield('missing')")
raises(AttributeError, "struct.setfield('missing', 42)")
+
+ def test_compute_shape(self):
+ from _ffi import Structure, Field, types
+ class Point(Structure):
+ _fields_ = [
+ Field('x', types.slong),
+ Field('y', types.slong),
+ ]
+
+ longsize = types.slong.sizeof()
+ assert isinstance(Point.x, Field)
+ assert isinstance(Point.y, Field)
+ assert Point.x.offset == 0
+ assert Point.y.offset == longsize
+ assert Point._struct_.ffitype.sizeof() == longsize*2
+ assert Point._struct_.ffitype.name == 'struct Point'
+
More information about the pypy-commit
mailing list