summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-12 19:54:27 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-12 19:54:27 (GMT)
commit0d8a1fd78d68093631e3ad8d8b19b0af300807c5 (patch)
treef9d42e9232c06ce5cf378fadfae3778591fe8fbd
parentd68d131d29380af5a4adffb791b80049dc737c13 (diff)
downloadcpython-0d8a1fd78d68093631e3ad8d8b19b0af300807c5.zip
cpython-0d8a1fd78d68093631e3ad8d8b19b0af300807c5.tar.gz
cpython-0d8a1fd78d68093631e3ad8d8b19b0af300807c5.tar.bz2
Simple fixes.
-rw-r--r--Lib/ctypes/test/test_internals.py10
-rw-r--r--Lib/ctypes/test/test_random_things.py4
2 files changed, 7 insertions, 7 deletions
diff --git a/Lib/ctypes/test/test_internals.py b/Lib/ctypes/test/test_internals.py
index 509d2c4..520ff87 100644
--- a/Lib/ctypes/test/test_internals.py
+++ b/Lib/ctypes/test/test_internals.py
@@ -23,16 +23,16 @@ class ObjectsTestCase(unittest.TestCase):
def test_ints(self):
i = 42000123
- self.failUnlessEqual(3, grc(i))
+ rc = grc(i)
ci = c_int(i)
- self.failUnlessEqual(3, grc(i))
+ self.failUnlessEqual(rc, grc(i))
self.failUnlessEqual(ci._objects, None)
def test_c_char_p(self):
- s = "Hello, World"
- self.failUnlessEqual(3, grc(s))
+ s = b"Hello, World"
+ rc = grc(s)
cs = c_char_p(s)
- self.failUnlessEqual(4, grc(s))
+ self.failUnlessEqual(rc + 1, grc(s))
self.failUnlessSame(cs._objects, s)
def test_simple_struct(self):
diff --git a/Lib/ctypes/test/test_random_things.py b/Lib/ctypes/test/test_random_things.py
index 12b4e62..e83f59c 100644
--- a/Lib/ctypes/test/test_random_things.py
+++ b/Lib/ctypes/test/test_random_things.py
@@ -17,7 +17,7 @@ if sys.platform == "win32":
windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
windll.kernel32.GetProcAddress.restype = c_void_p
- hdll = windll.kernel32.LoadLibraryA("kernel32")
+ hdll = windll.kernel32.LoadLibraryA(b"kernel32")
funcaddr = windll.kernel32.GetProcAddress(hdll, "GetModuleHandleA")
self.failUnlessEqual(call_function(funcaddr, (None,)),
@@ -69,7 +69,7 @@ class CallbackTracbackTestCase(unittest.TestCase):
out = self.capture_stderr(cb, "spam")
self.failUnlessEqual(out.splitlines()[-1],
"TypeError: "
- "unsupported operand type(s) for /: 'int' and 'str'")
+ "unsupported operand type(s) for /: 'int' and 'str8'")
if __name__ == '__main__':
unittest.main()