summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2009-07-21 06:27:14 (GMT)
committerThomas Heller <theller@ctypes.org>2009-07-21 06:27:14 (GMT)
commit6adda9641d41c858cfe2318f9e4e5b898ee1dce4 (patch)
treea6a4f5f1d67d5a732f9bbc51af761ee01f6671dc /Lib/ctypes
parent4d4b7398a283da7f8cf0e2f7bc7abd9a054b169f (diff)
downloadcpython-6adda9641d41c858cfe2318f9e4e5b898ee1dce4.zip
cpython-6adda9641d41c858cfe2318f9e4e5b898ee1dce4.tar.gz
cpython-6adda9641d41c858cfe2318f9e4e5b898ee1dce4.tar.bz2
Issue #6493: Fix a ctypes problem setting bitfields more than 31 bits
wide.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/test/test_bitfields.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/ctypes/test/test_bitfields.py
index e9c46c2..211d1db 100644
--- a/Lib/ctypes/test/test_bitfields.py
+++ b/Lib/ctypes/test/test_bitfields.py
@@ -240,5 +240,20 @@ class BitFieldTest(unittest.TestCase):
_anonymous_ = ["_"]
_fields_ = [("_", X)]
+ def test_uint32(self):
+ class X(Structure):
+ _fields_ = [("a", c_uint32, 32)]
+ x = X()
+ x.a = 10
+ self.failUnlessEqual(x.a, 10)
+
+ def test_uint64(self):
+ class X(Structure):
+ _fields_ = [("a", c_uint64, 64)]
+ x = X()
+ x.a = 10
+ self.failUnlessEqual(x.a, 10)
+
+
if __name__ == "__main__":
unittest.main()