[Python-3000-checkins] r56334 - python/branches/py3k-struni/Lib/ctypes/test/test_internals.py python/branches/py3k-struni/Lib/ctypes/test/test_random_things.py
thomas.heller
python-3000-checkins at python.org
Thu Jul 12 21:54:27 CEST 2007
Author: thomas.heller
Date: Thu Jul 12 21:54:27 2007
New Revision: 56334
Modified:
python/branches/py3k-struni/Lib/ctypes/test/test_internals.py
python/branches/py3k-struni/Lib/ctypes/test/test_random_things.py
Log:
Simple fixes.
Modified: python/branches/py3k-struni/Lib/ctypes/test/test_internals.py
==============================================================================
--- python/branches/py3k-struni/Lib/ctypes/test/test_internals.py (original)
+++ python/branches/py3k-struni/Lib/ctypes/test/test_internals.py Thu Jul 12 21:54:27 2007
@@ -23,16 +23,16 @@
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):
Modified: python/branches/py3k-struni/Lib/ctypes/test/test_random_things.py
==============================================================================
--- python/branches/py3k-struni/Lib/ctypes/test/test_random_things.py (original)
+++ python/branches/py3k-struni/Lib/ctypes/test/test_random_things.py Thu Jul 12 21:54:27 2007
@@ -17,7 +17,7 @@
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 @@
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()
More information about the Python-3000-checkins
mailing list