Commits

Armin Rigo  committed 6831272

Fix the test (by changing it), and fix the test (by changing the tested
code).

  • Participants
  • Parent commits 61bfeb8

Comments (0)

Files changed (2)

File c/_ffi_backend.c

         fmin = 0LL;
         fmax = (PY_LONG_LONG)((1ULL << cf->cf_bitsize) - 1ULL);
     }
-    if (value < fmin || value > fmax) {
+    if ((value < fmin || value > fmax) && value != 1) {
         PyErr_Format(PyExc_OverflowError,
                      "value %lld outside the range allowed by the "
                      "bit field width: %lld <= x <= %llx",
     p.a1 = -1
     assert p.a1 == -1
     p.a1 = 0
-    py.test.raises(OverflowError, "p.a1 = 1")
+    py.test.raises(OverflowError, "p.a1 = 2")
     assert p.a1 == 0
     #
     p.a1 = -1