Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r836:c0ca0cf9f274 Date: 2012-08-12 23:51 +0200 http://bitbucket.org/cffi/cffi/changeset/c0ca0cf9f274/
Log: Additional test for this case diff --git a/c/test_c.py b/c/test_c.py --- a/c/test_c.py +++ b/c/test_c.py @@ -944,6 +944,16 @@ stderr = ll.read_variable(BVoidP, "stderr") assert stderr == cast(BVoidP, _testfunc(8)) +def test_read_variable_as_unknown_length_array(): + if sys.platform == 'win32': + py.test.skip("untested") + 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") + # ^^ and not 'char[]', which is basically not allowed and would crash + def test_write_variable(): if sys.platform == 'win32': py.test.skip("untested") _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit