#NEWLINE# def test_verify_anonymous_enum_with_typedef( ) : #NEWLINE# #INDENT# ffi = FFI ( ) #NEWLINE# ffi . cdef ( 'typedef enum { AA, ... } e1;' ) #NEWLINE# lib = verify ( ffi , 'test_verify_anonymous_enum_with_typedef1' , 'typedef enum { BB, CC, AA } e1;' ) #NEWLINE# assert ( lib . AA == 2 ) #NEWLINE# assert ( ffi . sizeof ( 'e1' ) == ffi . sizeof ( 'int' ) ) #NEWLINE# assert ( repr ( ffi . cast ( 'e1' , 2 ) ) == "<cdata 'e1' 2: AA>" ) #NEWLINE# ffi = FFI ( ) #NEWLINE# ffi . cdef ( ( 'typedef enum { AA=%d } e1;' % sys . maxsize ) ) #NEWLINE# lib = verify ( ffi , 'test_verify_anonymous_enum_with_typedef2' , ( 'typedef enum { AA=%d } e1;' % sys . maxsize ) ) #NEWLINE# assert ( lib . AA == int ( ffi . cast ( 'long' , sys . maxsize ) ) ) #NEWLINE# assert ( ffi . sizeof ( 'e1' ) == ffi . sizeof ( 'long' ) )