From: Thomas Heller Date: Wed, 12 Dec 2007 20:01:44 +0000 (+0000) Subject: Add a comment to explain why we have to restore the original value. X-Git-Tag: v3.0a3~301 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8189f3b5a2f7e14218934daf909e1ffd8800a0b;p=thirdparty%2FPython%2Fcpython.git Add a comment to explain why we have to restore the original value. --- diff --git a/Lib/ctypes/test/test_values.py b/Lib/ctypes/test/test_values.py index a39674f3875b..476b7b796f35 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())