fix testcases assuming char is signed (thanks to Yaroslav Halchenko)
authorLisandro Dalcin <dalcinl@gmail.com>
Fri, 18 Feb 2011 19:11:11 +0000 (16:11 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Fri, 18 Feb 2011 19:11:11 +0000 (16:11 -0300)
tests/run/c_int_types_T255.pyx
tests/run/dictintindex.pyx

index 23220d5aa6cddccd4cc1d6e899f17e084bd2173b..82ca0e57372183953dd96f3d8aec09a63442d271 100644 (file)
@@ -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)
index 2a83ac9c2b2b7c40baffc09f390771d199226cc4..9e60f0d259b5645a13cfc846b63f4cef20a060d4 100644 (file)
@@ -4,7 +4,10 @@ def test_get_char_neg():
     0
     """
     cdef char key = -1
-    d = {-1:0}
+    if <char>-1 < 0:
+        d = {-1:0}
+    else:
+        d = {255:0}
     return d[key]
 def test_get_char_zero():
     """