spacepaste

  1.  
  2. # This test
  3. def test___buffer__(self):
  4. import sys
  5. if '__pypy__' not in sys.builtin_module_names:
  6. skip('pypy only test')
  7. module = self.import_module(name='array')
  8. a = module.array('i', [1, 2, 3])
  9. v = map(ord, a.__buffer__())
  10. assert v == [1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]
  11. # has this in stderr
  12. <function _Py_InitPyPyModule at 0x7f603b4dd320> DONE
  13. <function PyType_Ready at 0x7f603b3d4a28> DONE
  14. <function PyType_Ready at 0x7f603b3d4a28> DONE
  15. <function PyModule_Check at 0x7f603b4dd578> DONE
  16. <function PyModule_GetDict at 0x7f603b4dd6e0> DONE
  17. <function PyDict_GetItemString at 0x7f603b38b938> DONE
  18. <function PyDict_SetItemString at 0x7f603b38b758> DONE
  19. <function PyModule_Check at 0x7f603b4dd578> DONE
  20. <function PyModule_GetDict at 0x7f603b4dd6e0> DONE
  21. <function PyDict_GetItemString at 0x7f603b38b938> DONE
  22. <function PyDict_SetItemString at 0x7f603b38b758> DONE
  23. <function PyModule_Check at 0x7f603b4dd578> DONE
  24. <function PyModule_GetDict at 0x7f603b4dd6e0> DONE
  25. <function PyDict_GetItemString at 0x7f603b38b938> DONE
  26. <function PyDict_SetItemString at 0x7f603b38b758> DONE
  27. <function tp_new_wrapper at 0x7f603b3d1140> <function PyTuple_Check at 0x7f603b3e3b90> DONE
  28. <function PyString_Check at 0x7f603b421140> DONE
  29. <function PyString_Size at 0x7f603b424230> DONE
  30. <function PyString_AS_STRING at 0x7f603b421e60> DONE
  31. <function PyList_Check at 0x7f603b3958c0> DONE
  32. <function PyList_Check at 0x7f603b3958c0> DONE
  33. <function PySequence_Size at 0x7f603b3a7f50> DONE
  34. <function PyType_GenericAlloc at 0x7f603b3d9140> DONE
  35. <function PySequence_GetItem at 0x7f603b33c320> DONE
  36. <function PyFloat_Check at 0x7f603b8269b0> DONE
  37. <function PyInt_AsLong at 0x7f603b297c80> DONE
  38. <function PySequence_GetItem at 0x7f603b33c320> DONE
  39. <function PyFloat_Check at 0x7f603b8269b0> DONE
  40. <function PyInt_AsLong at 0x7f603b297c80> DONE
  41. <function PySequence_GetItem at 0x7f603b33c320> DONE
  42. <function PyFloat_Check at 0x7f603b8269b0> DONE
  43. <function PyInt_AsLong at 0x7f603b297c80> DONE
  44. DONE
  45. <function PyObject_GenericGetAttr at 0x7f603b2a7410> DONE
  46. <function PyBuffer_FillInfo at 0x7f603b347c80> DONE
  47. Exception Exception: Exception('invalid free() - data already freed or not allocated from RPython at all',) in <function callback at 0x7f6038654b18> ignored
  48. Fdealloc_trigger...
  49. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x2276f60>
  50. <function tuple_dealloc at 0x7f603b3ed0c8> <function PyObject_Free at 0x7f603b31eb18> DONE
  51. DONE
  52. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x235f490>
  53. <function dict_dealloc at 0x7f603b389a28> <function PyObject_Free at 0x7f603b31eb18> DONE
  54. DONE
  55. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x2361460>
  56. <function tuple_dealloc at 0x7f603b3ed0c8> <function PyObject_Free at 0x7f603b31eb18> DONE
  57. DONE
  58. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x2369730>
  59. <function subtype_dealloc at 0x7f603b3d1848> <function PyObject_dealloc at 0x7f603b320230> <function PyObject_Free at 0x7f603b31eb18> DONE
  60. DONE
  61. DONE
  62. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x236abd0>
  63. <function subtype_dealloc at 0x7f603b3d1848> <function PyObject_dealloc at 0x7f603b320230> <function PyObject_Free at 0x7f603b31eb18> DONE
  64. DONE
  65. DONE
  66. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x236c3b0>
  67. <function subtype_dealloc at 0x7f603b3d1848> <function PyObject_dealloc at 0x7f603b320230> <function PyObject_Free at 0x7f603b31eb18> DONE
  68. DONE
  69. DONE
  70. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x23994b0>
  71. <function subtype_dealloc at 0x7f603b3d1848> <function PyObject_dealloc at 0x7f603b320230> <function PyObject_Free at 0x7f603b31eb18> DONE
  72. DONE
  73. DONE
  74. dealloc_trigger DONE
  75. dealloc_trigger...
  76. deallocating PyObject * <C object Struct PyObject { c_ob_refcnt, c_ob_pypy_link, c_ob_type } at 0x235f470>
  77. <function subtype_dealloc at 0x7f603b3d1848> <function PyObject_dealloc at 0x7f603b320230> <function PyObject_Free at 0x7f603b31eb18> DONE
  78. DONE
  79. DONE
  80. dealloc_trigger DONE
  81.