#NEWLINE# def test_include_5( ) : #NEWLINE# #INDENT# ffi1 = FFI ( ) #NEWLINE# ffi1 . cdef ( 'typedef struct { int x[2]; int y; } *mystruct_p;' ) #NEWLINE# verify ( ffi1 , 'test_include_5_parent' , 'typedef struct { int x[2]; int y; } *mystruct_p;' ) #NEWLINE# ffi = FFI ( ) #NEWLINE# ffi . include ( ffi1 ) #NEWLINE# ffi . cdef ( 'mystruct_p ff5(mystruct_p);' ) #NEWLINE# lib = verify ( ffi , 'test_include_5' , 'typedef struct {int x[2]; int y; } *mystruct_p; //usually #include\nmystruct_p ff5(mystruct_p p) { p->x[1] += 42; return p; }' ) #NEWLINE# assert ( ffi . alignof ( ffi . typeof ( 'mystruct_p' ) . item ) == 4 ) #NEWLINE# assert ( ffi1 . typeof ( 'mystruct_p' ) is ffi . typeof ( 'mystruct_p' ) ) #NEWLINE# p = ffi . new ( 'mystruct_p' , [ [ 5 , 10 ] , ( - 17 ) ] ) #NEWLINE# q = lib . ff5 ( p ) #NEWLINE# assert ( q == p ) #NEWLINE# assert ( p . x [ 0 ] == 5 ) #NEWLINE# assert ( p . x [ 1 ] == 52 ) #NEWLINE# assert ( p . y == ( - 17 ) ) #NEWLINE# assert ( ffi . alignof ( ffi . typeof ( p [ 0 ] ) ) == 4 )