Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 1 | import unittest |
| 2 | from test import test_support |
| 3 | import sys |
| 4 | |
| 5 | import warnings, re |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 6 | warnings.filterwarnings("ignore", |
| 7 | category=DeprecationWarning, |
| 8 | message=".*integer argument expected, got float", |
| 9 | module=__name__) |
| 10 | warnings.filterwarnings("ignore", |
| 11 | category=DeprecationWarning, |
| 12 | message=".*integer argument expected, got float", |
| 13 | module="unittest") |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 14 | |
| 15 | """ |
| 16 | > How about the following counterproposal. This also changes some of |
| 17 | > the other format codes to be a little more regular. |
| 18 | > |
| 19 | > Code C type Range check |
| 20 | > |
| 21 | > b unsigned char 0..UCHAR_MAX |
Guido van Rossum | bbb931b | 2003-04-18 00:13:53 +0000 | [diff] [blame] | 22 | > h signed short SHRT_MIN..SHRT_MAX |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 23 | > B unsigned char none ** |
| 24 | > H unsigned short none ** |
| 25 | > k * unsigned long none |
| 26 | > I * unsigned int 0..UINT_MAX |
| 27 | |
| 28 | |
| 29 | > i int INT_MIN..INT_MAX |
| 30 | > l long LONG_MIN..LONG_MAX |
| 31 | |
| 32 | > K * unsigned long long none |
| 33 | > L long long LLONG_MIN..LLONG_MAX |
| 34 | |
| 35 | > Notes: |
| 36 | > |
| 37 | > * New format codes. |
| 38 | > |
| 39 | > ** Changed from previous "range-and-a-half" to "none"; the |
| 40 | > range-and-a-half checking wasn't particularly useful. |
| 41 | |
| 42 | Plus a C API or two, e.g. PyInt_AsLongMask() -> |
| 43 | unsigned long and PyInt_AsLongLongMask() -> unsigned |
| 44 | long long (if that exists). |
| 45 | """ |
| 46 | |
| 47 | LARGE = 0x7FFFFFFF |
| 48 | VERY_LARGE = 0xFF0000121212121212121242L |
| 49 | |
| 50 | from _testcapi import UCHAR_MAX, USHRT_MAX, UINT_MAX, ULONG_MAX, INT_MAX, \ |
Georg Brandl | 7f573f7 | 2006-04-13 07:59:30 +0000 | [diff] [blame] | 51 | INT_MIN, LONG_MIN, LONG_MAX, PY_SSIZE_T_MIN, PY_SSIZE_T_MAX |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 52 | |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 53 | # fake, they are not defined in Python's header files |
| 54 | LLONG_MAX = 2**63-1 |
| 55 | LLONG_MIN = -2**63 |
| 56 | ULLONG_MAX = 2**64-1 |
| 57 | |
| 58 | class Long: |
| 59 | def __int__(self): |
| 60 | return 99L |
| 61 | |
| 62 | class Int: |
| 63 | def __int__(self): |
| 64 | return 99 |
| 65 | |
| 66 | class Unsigned_TestCase(unittest.TestCase): |
| 67 | def test_b(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 68 | from _testcapi import getargs_b |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 69 | # b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX) |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 70 | self.failUnlessEqual(3, getargs_b(3.14)) |
| 71 | self.failUnlessEqual(99, getargs_b(Long())) |
| 72 | self.failUnlessEqual(99, getargs_b(Int())) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 73 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 74 | self.assertRaises(OverflowError, getargs_b, -1) |
| 75 | self.failUnlessEqual(0, getargs_b(0)) |
| 76 | self.failUnlessEqual(UCHAR_MAX, getargs_b(UCHAR_MAX)) |
| 77 | self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 78 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 79 | self.failUnlessEqual(42, getargs_b(42)) |
| 80 | self.failUnlessEqual(42, getargs_b(42L)) |
| 81 | self.assertRaises(OverflowError, getargs_b, VERY_LARGE) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 82 | |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 83 | def test_B(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 84 | from _testcapi import getargs_B |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 85 | # B returns 'unsigned char', no range checking |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 86 | self.failUnlessEqual(3, getargs_B(3.14)) |
| 87 | self.failUnlessEqual(99, getargs_B(Long())) |
| 88 | self.failUnlessEqual(99, getargs_B(Int())) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 89 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 90 | self.failUnlessEqual(UCHAR_MAX, getargs_B(-1)) |
| 91 | self.failUnlessEqual(UCHAR_MAX, getargs_B(-1L)) |
| 92 | self.failUnlessEqual(0, getargs_B(0)) |
| 93 | self.failUnlessEqual(UCHAR_MAX, getargs_B(UCHAR_MAX)) |
| 94 | self.failUnlessEqual(0, getargs_B(UCHAR_MAX+1)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 95 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 96 | self.failUnlessEqual(42, getargs_B(42)) |
| 97 | self.failUnlessEqual(42, getargs_B(42L)) |
| 98 | self.failUnlessEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 99 | |
| 100 | def test_H(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 101 | from _testcapi import getargs_H |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 102 | # H returns 'unsigned short', no range checking |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 103 | self.failUnlessEqual(3, getargs_H(3.14)) |
| 104 | self.failUnlessEqual(99, getargs_H(Long())) |
| 105 | self.failUnlessEqual(99, getargs_H(Int())) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 106 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 107 | self.failUnlessEqual(USHRT_MAX, getargs_H(-1)) |
| 108 | self.failUnlessEqual(0, getargs_H(0)) |
| 109 | self.failUnlessEqual(USHRT_MAX, getargs_H(USHRT_MAX)) |
| 110 | self.failUnlessEqual(0, getargs_H(USHRT_MAX+1)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 111 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 112 | self.failUnlessEqual(42, getargs_H(42)) |
| 113 | self.failUnlessEqual(42, getargs_H(42L)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 114 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 115 | self.failUnlessEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 116 | |
| 117 | def test_I(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 118 | from _testcapi import getargs_I |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 119 | # I returns 'unsigned int', no range checking |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 120 | self.failUnlessEqual(3, getargs_I(3.14)) |
| 121 | self.failUnlessEqual(99, getargs_I(Long())) |
| 122 | self.failUnlessEqual(99, getargs_I(Int())) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 123 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 124 | self.failUnlessEqual(UINT_MAX, getargs_I(-1)) |
| 125 | self.failUnlessEqual(0, getargs_I(0)) |
| 126 | self.failUnlessEqual(UINT_MAX, getargs_I(UINT_MAX)) |
| 127 | self.failUnlessEqual(0, getargs_I(UINT_MAX+1)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 128 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 129 | self.failUnlessEqual(42, getargs_I(42)) |
| 130 | self.failUnlessEqual(42, getargs_I(42L)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 131 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 132 | self.failUnlessEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 133 | |
| 134 | def test_k(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 135 | from _testcapi import getargs_k |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 136 | # k returns 'unsigned long', no range checking |
| 137 | # it does not accept float, or instances with __int__ |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 138 | self.assertRaises(TypeError, getargs_k, 3.14) |
| 139 | self.assertRaises(TypeError, getargs_k, Long()) |
| 140 | self.assertRaises(TypeError, getargs_k, Int()) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 141 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 142 | self.failUnlessEqual(ULONG_MAX, getargs_k(-1)) |
| 143 | self.failUnlessEqual(0, getargs_k(0)) |
| 144 | self.failUnlessEqual(ULONG_MAX, getargs_k(ULONG_MAX)) |
| 145 | self.failUnlessEqual(0, getargs_k(ULONG_MAX+1)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 146 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 147 | self.failUnlessEqual(42, getargs_k(42)) |
| 148 | self.failUnlessEqual(42, getargs_k(42L)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 149 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 150 | self.failUnlessEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 151 | |
| 152 | class Signed_TestCase(unittest.TestCase): |
| 153 | def test_i(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 154 | from _testcapi import getargs_i |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 155 | # i returns 'int', and does range checking (INT_MIN ... INT_MAX) |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 156 | self.failUnlessEqual(3, getargs_i(3.14)) |
| 157 | self.failUnlessEqual(99, getargs_i(Long())) |
| 158 | self.failUnlessEqual(99, getargs_i(Int())) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 159 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 160 | self.assertRaises(OverflowError, getargs_i, INT_MIN-1) |
| 161 | self.failUnlessEqual(INT_MIN, getargs_i(INT_MIN)) |
| 162 | self.failUnlessEqual(INT_MAX, getargs_i(INT_MAX)) |
| 163 | self.assertRaises(OverflowError, getargs_i, INT_MAX+1) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 164 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 165 | self.failUnlessEqual(42, getargs_i(42)) |
| 166 | self.failUnlessEqual(42, getargs_i(42L)) |
| 167 | self.assertRaises(OverflowError, getargs_i, VERY_LARGE) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 168 | |
| 169 | def test_l(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 170 | from _testcapi import getargs_l |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 171 | # l returns 'long', and does range checking (LONG_MIN ... LONG_MAX) |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 172 | self.failUnlessEqual(3, getargs_l(3.14)) |
| 173 | self.failUnlessEqual(99, getargs_l(Long())) |
| 174 | self.failUnlessEqual(99, getargs_l(Int())) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 175 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 176 | self.assertRaises(OverflowError, getargs_l, LONG_MIN-1) |
| 177 | self.failUnlessEqual(LONG_MIN, getargs_l(LONG_MIN)) |
| 178 | self.failUnlessEqual(LONG_MAX, getargs_l(LONG_MAX)) |
| 179 | self.assertRaises(OverflowError, getargs_l, LONG_MAX+1) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 180 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 181 | self.failUnlessEqual(42, getargs_l(42)) |
| 182 | self.failUnlessEqual(42, getargs_l(42L)) |
| 183 | self.assertRaises(OverflowError, getargs_l, VERY_LARGE) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 184 | |
Georg Brandl | 7f573f7 | 2006-04-13 07:59:30 +0000 | [diff] [blame] | 185 | def test_n(self): |
| 186 | from _testcapi import getargs_n |
Tim Peters | 8e6480c | 2006-04-13 22:58:42 +0000 | [diff] [blame] | 187 | # n returns 'Py_ssize_t', and does range checking |
Georg Brandl | 7f573f7 | 2006-04-13 07:59:30 +0000 | [diff] [blame] | 188 | # (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX) |
| 189 | self.failUnlessEqual(3, getargs_n(3.14)) |
| 190 | self.failUnlessEqual(99, getargs_n(Long())) |
| 191 | self.failUnlessEqual(99, getargs_n(Int())) |
| 192 | |
| 193 | self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1) |
| 194 | self.failUnlessEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN)) |
| 195 | self.failUnlessEqual(PY_SSIZE_T_MAX, getargs_n(PY_SSIZE_T_MAX)) |
| 196 | self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1) |
| 197 | |
| 198 | self.failUnlessEqual(42, getargs_n(42)) |
| 199 | self.failUnlessEqual(42, getargs_n(42L)) |
| 200 | self.assertRaises(OverflowError, getargs_n, VERY_LARGE) |
| 201 | |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 202 | |
| 203 | class LongLong_TestCase(unittest.TestCase): |
| 204 | def test_L(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 205 | from _testcapi import getargs_L |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 206 | # L returns 'long long', and does range checking (LLONG_MIN ... LLONG_MAX) |
Martin v. Löwis | 6ce7ed2 | 2005-03-03 12:26:35 +0000 | [diff] [blame] | 207 | self.failUnlessRaises(TypeError, getargs_L, "Hello") |
| 208 | self.failUnlessEqual(3, getargs_L(3.14)) |
| 209 | self.failUnlessEqual(99, getargs_L(Long())) |
| 210 | self.failUnlessEqual(99, getargs_L(Int())) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 211 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 212 | self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1) |
| 213 | self.failUnlessEqual(LLONG_MIN, getargs_L(LLONG_MIN)) |
| 214 | self.failUnlessEqual(LLONG_MAX, getargs_L(LLONG_MAX)) |
| 215 | self.assertRaises(OverflowError, getargs_L, LLONG_MAX+1) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 216 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 217 | self.failUnlessEqual(42, getargs_L(42)) |
| 218 | self.failUnlessEqual(42, getargs_L(42L)) |
| 219 | self.assertRaises(OverflowError, getargs_L, VERY_LARGE) |
Tim Peters | 0eadaac | 2003-04-24 16:02:54 +0000 | [diff] [blame] | 220 | |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 221 | def test_K(self): |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 222 | from _testcapi import getargs_K |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 223 | # K return 'unsigned long long', no range checking |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 224 | self.assertRaises(TypeError, getargs_K, 3.14) |
| 225 | self.assertRaises(TypeError, getargs_K, Long()) |
| 226 | self.assertRaises(TypeError, getargs_K, Int()) |
| 227 | self.failUnlessEqual(ULLONG_MAX, getargs_K(ULLONG_MAX)) |
| 228 | self.failUnlessEqual(0, getargs_K(0)) |
| 229 | self.failUnlessEqual(0, getargs_K(ULLONG_MAX+1)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 230 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 231 | self.failUnlessEqual(42, getargs_K(42)) |
| 232 | self.failUnlessEqual(42, getargs_K(42L)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 233 | |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 234 | self.failUnlessEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE)) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 235 | |
Georg Brandl | 5f13578 | 2006-07-26 08:03:10 +0000 | [diff] [blame] | 236 | |
| 237 | class Tuple_TestCase(unittest.TestCase): |
| 238 | def test_tuple(self): |
| 239 | from _testcapi import getargs_tuple |
Tim Peters | 95621b2 | 2006-07-26 23:23:15 +0000 | [diff] [blame^] | 240 | |
Georg Brandl | 5f13578 | 2006-07-26 08:03:10 +0000 | [diff] [blame] | 241 | ret = getargs_tuple(1, (2, 3)) |
| 242 | self.assertEquals(ret, (1,2,3)) |
| 243 | |
| 244 | # make sure invalid tuple arguments are handled correctly |
| 245 | class seq: |
| 246 | def __len__(self): |
| 247 | return 2 |
| 248 | def __getitem__(self, n): |
| 249 | raise ValueError |
| 250 | self.assertRaises(TypeError, getargs_tuple, 1, seq()) |
| 251 | |
| 252 | |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 253 | def test_main(): |
Georg Brandl | 5f13578 | 2006-07-26 08:03:10 +0000 | [diff] [blame] | 254 | tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase] |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 255 | try: |
Thomas Heller | 54aa578 | 2003-04-24 16:15:29 +0000 | [diff] [blame] | 256 | from _testcapi import getargs_L, getargs_K |
| 257 | except ImportError: |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 258 | pass # PY_LONG_LONG not available |
| 259 | else: |
Walter Dörwald | 21d3a32 | 2003-05-01 17:45:56 +0000 | [diff] [blame] | 260 | tests.append(LongLong_TestCase) |
| 261 | test_support.run_unittest(*tests) |
Thomas Heller | a4ea603 | 2003-04-17 18:55:45 +0000 | [diff] [blame] | 262 | |
| 263 | if __name__ == "__main__": |
| 264 | test_main() |