Back to index

python3.2  3.2.2
Classes | Public Member Functions
ctypes.test.test_values.ValuesTestCase Class Reference

List of all members.

Classes

class  Win_ValuesTestCase

Public Member Functions

def test_an_integer
def test_undefined

Detailed Description

Definition at line 10 of file test_values.py.


Member Function Documentation

Definition at line 12 of file test_values.py.

00012 
00013     def test_an_integer(self):
00014         # This test checks and changes an integer stored inside the
00015         # _ctypes_test dll/shared lib.
00016         ctdll = CDLL(_ctypes_test.__file__)
00017         an_integer = c_int.in_dll(ctdll, "an_integer")
00018         x = an_integer.value
00019         self.assertEqual(x, ctdll.get_an_integer())
00020         an_integer.value *= 2
00021         self.assertEqual(x*2, ctdll.get_an_integer())
00022         # To avoid test failures when this test is repeated several
00023         # times the original value must be restored
00024         an_integer.value = x
00025         self.assertEqual(x, ctdll.get_an_integer())

Here is the call graph for this function:

Definition at line 26 of file test_values.py.

00026 
00027     def test_undefined(self):
00028         ctdll = CDLL(_ctypes_test.__file__)
00029         self.assertRaises(ValueError, c_int.in_dll, ctdll, "Undefined_Symbol")

Here is the call graph for this function:


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