[pypy-issue] [issue1643] cffi test_read_variable assumes glibc

Tobias Oberstein tracker at bugs.pypy.org
Mon Nov 18 14:40:02 CET 2013

New submission from Tobias Oberstein <tobias.oberstein at gmail.com>:

>From pypy/module/_cffi_backend/test/_backend_test_c.py:

def test_read_variable_as_unknown_length_array():
    if sys.platform == 'win32' or sys.platform == 'darwin':
    BCharP = new_pointer_type(new_primitive_type("char"))
    BArray = new_array_type(BCharP, None)
    ll = find_and_load_library('c')
    stderr = ll.read_variable(BArray, "stderr")
    assert repr(stderr).startswith("<cdata 'char *' 0x")

This assumes "stderr" is a variable thingy, which is only the case on glibc, but

It breaks on *BSDs where stdin, stdout, and stderr are macros that you cannot
use like a variable.

So skipping this test is not quite right even for "darwin". The test is just
wrong. It tests glibc specific behavior, not standard C library behavior.

messages: 6364
nosy: oberstet, pypy-issue
priority: bug
status: unread
title: cffi test_read_variable assumes glibc

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list