From: Lisandro Dalcin Date: Fri, 18 Feb 2011 19:11:11 +0000 (-0300) Subject: fix testcases assuming char is signed (thanks to Yaroslav Halchenko) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2651a5d4a6f990898217be97161d0b884fdf6f8f;p=cython.git fix testcases assuming char is signed (thanks to Yaroslav Halchenko) --- diff --git a/tests/run/c_int_types_T255.pyx b/tests/run/c_int_types_T255.pyx index 23220d5a..82ca0e57 100644 --- a/tests/run/c_int_types_T255.pyx +++ b/tests/run/c_int_types_T255.pyx @@ -93,10 +93,10 @@ def test_char(char x): Traceback (most recent call last): ... OverflowError: ... + >>> if CHAR_MIN < 0: + ... assert test_char(-1) == -1 >>> test_char(CHAR_MIN) == CHAR_MIN True - >>> test_char(-1) - -1 >>> test_char(0) 0 >>> test_char(1) diff --git a/tests/run/dictintindex.pyx b/tests/run/dictintindex.pyx index 2a83ac9c..9e60f0d2 100644 --- a/tests/run/dictintindex.pyx +++ b/tests/run/dictintindex.pyx @@ -4,7 +4,10 @@ def test_get_char_neg(): 0 """ cdef char key = -1 - d = {-1:0} + if -1 < 0: + d = {-1:0} + else: + d = {255:0} return d[key] def test_get_char_zero(): """