Back to index

python3.2  3.2.2
Public Member Functions
ctypes.test.test_unicode.UnicodeTestCase Class Reference
Inheritance diagram for ctypes.test.test_unicode.UnicodeTestCase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def test_wcslen
def test_buffers

Detailed Description

Definition at line 11 of file test_unicode.py.


Member Function Documentation

Reimplemented in ctypes.test.test_unicode.StringTestCase.

Definition at line 21 of file test_unicode.py.

00021 
00022         def test_buffers(self):
00023             buf = ctypes.create_unicode_buffer("abc")
00024             self.assertEqual(len(buf), 3+1)
00025 
00026             buf = ctypes.create_unicode_buffer("ab\xe4\xf6\xfc")
00027             self.assertEqual(buf[:], "ab\xe4\xf6\xfc\0")
00028             self.assertEqual(buf[::], "ab\xe4\xf6\xfc\0")
00029             self.assertEqual(buf[::-1], '\x00\xfc\xf6\xe4ba')
00030             self.assertEqual(buf[::2], 'a\xe4\xfc')
00031             self.assertEqual(buf[6:5:-1], "")
00032 
    func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p

Here is the call graph for this function:

Definition at line 12 of file test_unicode.py.

00012 
00013         def test_wcslen(self):
00014             dll = ctypes.CDLL(_ctypes_test.__file__)
00015             wcslen = dll.my_wcslen
00016             wcslen.argtypes = [ctypes.c_wchar_p]
00017 
00018             self.assertEqual(wcslen("abc"), 3)
00019             self.assertEqual(wcslen("ab\u2070"), 3)
00020             self.assertRaises(ctypes.ArgumentError, wcslen, b"ab\xe4")

Here is the call graph for this function:


The documentation for this class was generated from the following file: