Commit 2651a5d4 authored by Lisandro Dalcin's avatar Lisandro Dalcin

fix testcases assuming char is signed (thanks to Yaroslav Halchenko)

parent e1261521
...@@ -93,10 +93,10 @@ def test_char(char x): ...@@ -93,10 +93,10 @@ def test_char(char x):
Traceback (most recent call last): Traceback (most recent call last):
... ...
OverflowError: ... OverflowError: ...
>>> if CHAR_MIN < 0:
... assert test_char(-1) == -1
>>> test_char(CHAR_MIN) == CHAR_MIN >>> test_char(CHAR_MIN) == CHAR_MIN
True True
>>> test_char(-1)
-1
>>> test_char(0) >>> test_char(0)
0 0
>>> test_char(1) >>> test_char(1)
......
...@@ -4,7 +4,10 @@ def test_get_char_neg(): ...@@ -4,7 +4,10 @@ def test_get_char_neg():
0 0
""" """
cdef char key = -1 cdef char key = -1
if <char>-1 < 0:
d = {-1:0} d = {-1:0}
else:
d = {255:0}
return d[key] return d[key]
def test_get_char_zero(): def test_get_char_zero():
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment