summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-12-12 20:01:44 (GMT)
committerThomas Heller <theller@ctypes.org>2007-12-12 20:01:44 (GMT)
commitb8189f3b5a2f7e14218934daf909e1ffd8800a0b (patch)
tree0eec9181048ba1880c78e61b7763b35fde90443b /Lib
parent3536a5c09c8e8fb248ac7ab89a45d75e9f91ea30 (diff)
downloadcpython-b8189f3b5a2f7e14218934daf909e1ffd8800a0b.zip
cpython-b8189f3b5a2f7e14218934daf909e1ffd8800a0b.tar.gz
cpython-b8189f3b5a2f7e14218934daf909e1ffd8800a0b.tar.bz2
Add a comment to explain why we have to restore the original value.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_values.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py
index a39674f..476b7b7 100644
--- a/Lib/ctypes/test/test_values.py
+++ b/Lib/ctypes/test/test_values.py
@@ -10,12 +10,16 @@ import _ctypes_test
class ValuesTestCase(unittest.TestCase):
def test_an_integer(self):
+ # This test checks and changes an integer stored inside the
+ # _ctypes_test dll/shared lib.
ctdll = CDLL(_ctypes_test.__file__)
an_integer = c_int.in_dll(ctdll, "an_integer")
x = an_integer.value
self.failUnlessEqual(x, ctdll.get_an_integer())
an_integer.value *= 2
self.failUnlessEqual(x*2, ctdll.get_an_integer())
+ # To avoid test failures when this test is repeated several
+ # times the original value must be restored
an_integer.value = x
self.failUnlessEqual(x, ctdll.get_an_integer())