Merge branch 'PyBuffer_Release-pybuffer'
* PyBuffer_Release-pybuffer: Add tests. Fix the error handling for the PyObject_GetBuffer() calls in pybuffer.i
This commit is contained in:
commit
4d5f4bcd33
2 changed files with 35 additions and 13 deletions
|
|
@ -44,3 +44,27 @@ else:
|
|||
buf3 = bytearray(b"hello")
|
||||
python_pybuffer.title1(buf3)
|
||||
check(buf3 == b"Hello")
|
||||
|
||||
try:
|
||||
python_pybuffer.func1(1)
|
||||
raise RuntimeError, "should throw TypeError"
|
||||
except TypeError, e:
|
||||
check("(char *buf1, int len)" in str(e))
|
||||
|
||||
try:
|
||||
python_pybuffer.func2(1)
|
||||
raise RuntimeError, "should throw TypeError"
|
||||
except TypeError, e:
|
||||
check("(char *buf2)" in str(e))
|
||||
|
||||
try:
|
||||
python_pybuffer.func3(1)
|
||||
raise RuntimeError, "should throw TypeError"
|
||||
except TypeError, e:
|
||||
check("(const char *buf3, int len)" in str(e))
|
||||
|
||||
try:
|
||||
python_pybuffer.func4(1)
|
||||
raise RuntimeError, "should throw TypeError"
|
||||
except TypeError, e:
|
||||
check("(const char *buf4)" in str(e))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue