Back to index

python3.2  3.2.2
Public Member Functions
ctypes.test.test_bytes.BytesTest Class Reference

List of all members.

Public Member Functions

def test_c_char
def test_c_wchar
def test_c_char_p
def test_c_wchar_p
def test_struct
def test_struct_W
def test_BSTR

Detailed Description

Definition at line 6 of file test_bytes.py.


Member Function Documentation

Definition at line 42 of file test_bytes.py.

00042 
00043         def test_BSTR(self):
00044             from _ctypes import _SimpleCData
00045             class BSTR(_SimpleCData):
00046                 _type_ = "X"
00047 
00048             BSTR("abc")

Definition at line 7 of file test_bytes.py.

00007 
00008     def test_c_char(self):
00009         x = c_char(b"x")
00010         x.value = b"y"
00011         c_char.from_param(b"x")
00012         (c_char * 3)(b"a", b"b", b"c")

Definition at line 19 of file test_bytes.py.

00019 
00020     def test_c_char_p(self):
00021         c_char_p(b"foo bar")

Definition at line 13 of file test_bytes.py.

00013 
00014     def test_c_wchar(self):
00015         x = c_wchar("x")
00016         x.value = "y"
00017         c_wchar.from_param("x")
00018         (c_wchar * 3)("a", "b", "c")

Definition at line 22 of file test_bytes.py.

00022 
00023     def test_c_wchar_p(self):
00024         c_wchar_p("foo bar")

Definition at line 25 of file test_bytes.py.

00025 
00026     def test_struct(self):
00027         class X(Structure):
00028             _fields_ = [("a", c_char * 3)]
00029 
00030         x = X(b"abc")
00031         self.assertEqual(x.a, b"abc")
00032         self.assertEqual(type(x.a), bytes)

Here is the call graph for this function:

Definition at line 33 of file test_bytes.py.

00033 
00034     def test_struct_W(self):
00035         class X(Structure):
00036             _fields_ = [("a", c_wchar * 3)]
00037 
00038         x = X("abc")
00039         self.assertEqual(x.a, "abc")
00040         self.assertEqual(type(x.a), str)

Here is the call graph for this function:


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