<s> """<STR_LIT>""" <EOL> import unittest <EOL> import sys <EOL> from ctypes import * <EOL> import _ctypes_test <EOL> class ValuesTestCase ( unittest . TestCase ) : <EOL> def test_an_integer ( self ) : <EOL> ctdll = CDLL ( _ctypes_test . __file__ ) <EOL> an_integer = c_int . in_dll ( ctdll , "<STR_LIT>" ) <EOL> x = an_integer . value <EOL> self . assertEqual ( x , ctdll . get_an_integer ( ) ) <EOL> an_integer . value *= <NUM_LIT:2> <EOL> self . assertEqual ( x * <NUM_LIT:2> , ctdll . get_an_integer ( ) ) <EOL> def test_undefined ( self ) : <EOL> ctdll = CDLL ( _ctypes_test . __file__ ) <EOL> self . assertRaises ( ValueError , c_int . in_dll , ctdll , "<STR_LIT>" ) <EOL> @ unittest . skipUnless ( sys . platform == '<STR_LIT:win32>' , '<STR_LIT>' ) <EOL> class Win_ValuesTestCase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_optimizeflag ( self ) : <EOL> opt = c_int . in_dll ( pythonapi , "<STR_LIT>" ) . value <EOL> if __debug__ : <EOL> self . assertEqual ( opt , <NUM_LIT:0> ) <EOL> elif ValuesTestCase . __doc__ is not None : <EOL> self . assertEqual ( opt , <NUM_LIT:1> ) <EOL> else : <EOL> self . assertEqual ( opt , <NUM_LIT:2> ) <EOL> def test_frozentable ( self ) : <EOL> class struct_frozen ( Structure ) : <EOL> _fields_ = [ ( "<STR_LIT:name>" , c_char_p ) , <EOL> ( "<STR_LIT:code>" , POINTER ( c_ubyte ) ) , <EOL> ( "<STR_LIT:size>" , c_int ) ] <EOL> FrozenTable = POINTER ( struct_frozen ) <EOL> ft = FrozenTable . in_dll ( pythonapi , "<STR_LIT>" ) <EOL> items = [ ] <EOL> for entry in ft : <EOL> if entry . name is None : <EOL> break <EOL> items . append ( ( entry . name , entry . size ) ) <EOL> expected = [ ( "<STR_LIT>" , <NUM_LIT> ) , <EOL> ( "<STR_LIT>" , - <NUM_LIT> ) , <EOL> ( "<STR_LIT>" , <NUM_LIT> ) ] <EOL> self . assertEqual ( items , expected ) <EOL> from ctypes import _pointer_type_cache <EOL> del _pointer_type_cache [ struct_frozen ] <EOL> def test_undefined ( self ) : <EOL> self . assertRaises ( ValueError , c_int . in_dll , pythonapi , <EOL> "<STR_LIT>" ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
