[pypy-svn] r75441 - pypy/trunk/pypy/module/_rawffi/test
fijal at codespeak.net
fijal at codespeak.net
Thu Jun 17 22:48:39 CEST 2010
Author: fijal
Date: Thu Jun 17 22:48:36 2010
New Revision: 75441
Modified:
pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py
Log:
Write a failing test
Modified: pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py
==============================================================================
--- pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py (original)
+++ pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py Thu Jun 17 22:48:36 2010
@@ -160,6 +160,17 @@
{
return 42;
}
+
+ typedef union {
+ short x;
+ long y;
+ } UN;
+
+ UN ret_un_func(UN inp)
+ {
+ inp.y = inp.x * 100;
+ return inp;
+ }
'''))
symbols = """get_char char_check get_raw_pointer
@@ -928,6 +939,17 @@
assert a[3] == 'z'
assert a[4] == 't'
+ def test_union(self):
+ skip("segfaulting")
+ import _rawffi
+ longsize = _rawffi.sizeof('l')
+ S = _rawffi.Structure((longsize, longsize))
+ s = S(autofree=False)
+ lib = _rawffi.CDLL(self.lib_name)
+ f = lib.ptr('ret_un_func', [(S, 1)], (S, 1))
+ ret = f(s)
+ s.free()
+
class AppTestAutoFree:
def setup_class(cls):
space = gettestobjspace(usemodules=('_rawffi', 'struct'))
More information about the Pypy-commit
mailing list