Commit 0d8a1fd7 authored by Thomas Heller's avatar Thomas Heller

Simple fixes.

parent d68d131d
...@@ -23,16 +23,16 @@ class ObjectsTestCase(unittest.TestCase): ...@@ -23,16 +23,16 @@ class ObjectsTestCase(unittest.TestCase):
def test_ints(self): def test_ints(self):
i = 42000123 i = 42000123
self.failUnlessEqual(3, grc(i)) rc = grc(i)
ci = c_int(i) ci = c_int(i)
self.failUnlessEqual(3, grc(i)) self.failUnlessEqual(rc, grc(i))
self.failUnlessEqual(ci._objects, None) self.failUnlessEqual(ci._objects, None)
def test_c_char_p(self): def test_c_char_p(self):
s = "Hello, World" s = b"Hello, World"
self.failUnlessEqual(3, grc(s)) rc = grc(s)
cs = c_char_p(s) cs = c_char_p(s)
self.failUnlessEqual(4, grc(s)) self.failUnlessEqual(rc + 1, grc(s))
self.failUnlessSame(cs._objects, s) self.failUnlessSame(cs._objects, s)
def test_simple_struct(self): def test_simple_struct(self):
......
...@@ -17,7 +17,7 @@ if sys.platform == "win32": ...@@ -17,7 +17,7 @@ if sys.platform == "win32":
windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p
windll.kernel32.GetProcAddress.restype = c_void_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") funcaddr = windll.kernel32.GetProcAddress(hdll, "GetModuleHandleA")
self.failUnlessEqual(call_function(funcaddr, (None,)), self.failUnlessEqual(call_function(funcaddr, (None,)),
...@@ -69,7 +69,7 @@ class CallbackTracbackTestCase(unittest.TestCase): ...@@ -69,7 +69,7 @@ class CallbackTracbackTestCase(unittest.TestCase):
out = self.capture_stderr(cb, "spam") out = self.capture_stderr(cb, "spam")
self.failUnlessEqual(out.splitlines()[-1], self.failUnlessEqual(out.splitlines()[-1],
"TypeError: " "TypeError: "
"unsupported operand type(s) for /: 'int' and 'str'") "unsupported operand type(s) for /: 'int' and 'str8'")
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment