diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ctypes/test/test_cast.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_cast.py b/Lib/ctypes/test/test_cast.py index 09e928fdb4..7371b0fe24 100644 --- a/Lib/ctypes/test/test_cast.py +++ b/Lib/ctypes/test/test_cast.py @@ -57,5 +57,21 @@ class Test(unittest.TestCase): c_int() self.failUnlessEqual(p[:4], [1, 2, 96, 4]) + def test_char_p(self): + # This didn't work: bad argument to internal function + s = c_char_p("hiho") + self.failUnlessEqual(cast(cast(s, c_void_p), c_char_p).value, + "hiho") + + try: + c_wchar_p + except NameError: + pass + else: + def test_wchar_p(self): + s = c_wchar_p("hiho") + self.failUnlessEqual(cast(cast(s, c_void_p), c_wchar_p).value, + "hiho") + if __name__ == "__main__": unittest.main() |