Back to index

python3.2  3.2.2
Public Member Functions
test.test_structmembers.ReadWriteTests Class Reference

List of all members.

Public Member Functions

def test_bool
def test_byte
def test_short
def test_int
def test_long
def test_py_ssize_t
def test_longlong
def test_bad_assignments
def test_inplace_string

Detailed Description

Definition at line 27 of file test_structmembers.py.


Member Function Documentation

Definition at line 90 of file test_structmembers.py.

00090 
00091     def test_bad_assignments(self):
00092         integer_attributes = [
00093             'T_BOOL',
00094             'T_BYTE', 'T_UBYTE',
00095             'T_SHORT', 'T_USHORT',
00096             'T_INT', 'T_UINT',
00097             'T_LONG', 'T_ULONG',
00098             'T_PYSSIZET'
00099             ]
00100         if hasattr(ts, 'T_LONGLONG'):
00101             integer_attributes.extend(['T_LONGLONG', 'T_ULONGLONG'])
00102 
00103         # issue8014: this produced 'bad argument to internal function'
00104         # internal error
00105         for nonint in None, 3.2j, "full of eels", {}, []:
00106             for attr in integer_attributes:
00107                 self.assertRaises(TypeError, setattr, ts, attr, nonint)

Here is the call graph for this function:

Definition at line 29 of file test_structmembers.py.

00029 
00030     def test_bool(self):
00031         ts.T_BOOL = True
00032         self.assertEqual(ts.T_BOOL, True)
00033         ts.T_BOOL = False
00034         self.assertEqual(ts.T_BOOL, False)
00035         self.assertRaises(TypeError, setattr, ts, 'T_BOOL', 1)

Here is the call graph for this function:

Definition at line 36 of file test_structmembers.py.

00036 
00037     def test_byte(self):
00038         ts.T_BYTE = CHAR_MAX
00039         self.assertEqual(ts.T_BYTE, CHAR_MAX)
00040         ts.T_BYTE = CHAR_MIN
00041         self.assertEqual(ts.T_BYTE, CHAR_MIN)
00042         ts.T_UBYTE = UCHAR_MAX
00043         self.assertEqual(ts.T_UBYTE, UCHAR_MAX)

Here is the call graph for this function:

Definition at line 108 of file test_structmembers.py.

00108 
00109     def test_inplace_string(self):
00110         self.assertEqual(ts.T_STRING_INPLACE, "hi")
00111         self.assertRaises(TypeError, setattr, ts, "T_STRING_INPLACE", "s")
00112         self.assertRaises(TypeError, delattr, ts, "T_STRING_INPLACE")
00113 

Here is the call graph for this function:

Definition at line 52 of file test_structmembers.py.

00052 
00053     def test_int(self):
00054         ts.T_INT = INT_MAX
00055         self.assertEqual(ts.T_INT, INT_MAX)
00056         ts.T_INT = INT_MIN
00057         self.assertEqual(ts.T_INT, INT_MIN)
00058         ts.T_UINT = UINT_MAX
00059         self.assertEqual(ts.T_UINT, UINT_MAX)

Here is the call graph for this function:

Definition at line 60 of file test_structmembers.py.

00060 
00061     def test_long(self):
00062         ts.T_LONG = LONG_MAX
00063         self.assertEqual(ts.T_LONG, LONG_MAX)
00064         ts.T_LONG = LONG_MIN
00065         self.assertEqual(ts.T_LONG, LONG_MIN)
00066         ts.T_ULONG = ULONG_MAX
00067         self.assertEqual(ts.T_ULONG, ULONG_MAX)

Here is the call graph for this function:

Definition at line 75 of file test_structmembers.py.

00075 
00076     def test_longlong(self):
00077         ts.T_LONGLONG = LLONG_MAX
00078         self.assertEqual(ts.T_LONGLONG, LLONG_MAX)
00079         ts.T_LONGLONG = LLONG_MIN
00080         self.assertEqual(ts.T_LONGLONG, LLONG_MIN)
00081 
00082         ts.T_ULONGLONG = ULLONG_MAX
00083         self.assertEqual(ts.T_ULONGLONG, ULLONG_MAX)
00084 
00085         ## make sure these will accept a plain int as well as a long
00086         ts.T_LONGLONG = 3
00087         self.assertEqual(ts.T_LONGLONG, 3)
00088         ts.T_ULONGLONG = 4
00089         self.assertEqual(ts.T_ULONGLONG, 4)

Here is the call graph for this function:

Definition at line 68 of file test_structmembers.py.

00068 
00069     def test_py_ssize_t(self):
00070         ts.T_PYSSIZET = PY_SSIZE_T_MAX
00071         self.assertEqual(ts.T_PYSSIZET, PY_SSIZE_T_MAX)
00072         ts.T_PYSSIZET = PY_SSIZE_T_MIN
00073         self.assertEqual(ts.T_PYSSIZET, PY_SSIZE_T_MIN)

Here is the call graph for this function:

Definition at line 44 of file test_structmembers.py.

00044 
00045     def test_short(self):
00046         ts.T_SHORT = SHRT_MAX
00047         self.assertEqual(ts.T_SHORT, SHRT_MAX)
00048         ts.T_SHORT = SHRT_MIN
00049         self.assertEqual(ts.T_SHORT, SHRT_MIN)
00050         ts.T_USHORT = USHRT_MAX
00051         self.assertEqual(ts.T_USHORT, USHRT_MAX)

Here is the call graph for this function:


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