#NEWLINE# def test_dir( ) : #NEWLINE# #INDENT# ffi = FFI ( ) #NEWLINE# ffi . cdef ( 'int ff(int); int aa; static const int my_constant;' ) #NEWLINE# lib = verify ( ffi , 'test_dir' , '\n        #define my_constant  (-45)\n        int aa;\n        int ff(int x) { return x+aa; }\n    ' ) #NEWLINE# lib . aa = 5 #NEWLINE# assert ( dir ( lib ) == [ 'aa' , 'ff' , 'my_constant' ] ) #NEWLINE# aaobj = lib . __dict__ [ 'aa' ] #NEWLINE# assert ( not isinstance ( aaobj , int ) ) #NEWLINE# assert ( lib . __dict__ == { #NEWLINE# #INDENT# 'ff' : lib . ff , #NEWLINE# 'aa' : aaobj , #NEWLINE# 'my_constant' : ( - 45 ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# lib . __dict__ [ 'ff' ] = '??' #NEWLINE# assert ( lib . ff ( 10 ) == 15 )