[pypy-commit] pypy default: Fix the test. _PyLong_FromByteArray() always produces nonsense (i.e. a

arigo pypy.commits at gmail.com
Sat Jan 2 20:10:54 EST 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r81527:e205bcf52d2f
Date: 2016-01-03 02:10 +0100
http://bitbucket.org/pypy/pypy/changeset/e205bcf52d2f/

Log:	Fix the test. _PyLong_FromByteArray() always produces nonsense (i.e.
	a different result than CPython), which needs to be fixed.

diff --git a/pypy/module/cpyext/test/test_longobject.py b/pypy/module/cpyext/test/test_longobject.py
--- a/pypy/module/cpyext/test/test_longobject.py
+++ b/pypy/module/cpyext/test/test_longobject.py
@@ -175,10 +175,10 @@
                                               little_endian, is_signed);
              """),
             ])
-        assert module.from_bytearray(True, False) == 0x9ABC
-        assert module.from_bytearray(True, True) == -0x6543
-        assert module.from_bytearray(False, False) == 0xBC9A
-        assert module.from_bytearray(False, True) == -0x4365
+        assert module.from_bytearray(True, False) == 0xBC9A
+        assert module.from_bytearray(True, True) == -0x4366
+        assert module.from_bytearray(False, False) == 0x9ABC
+        assert module.from_bytearray(False, True) == -0x6544
 
     def test_fromunicode(self):
         module = self.import_extension('foo', [


More information about the pypy-commit mailing list