#NEWLINE# def testHeaderParsing( self ) : #NEWLINE# #INDENT# l = Parser . parseSource ( testHeader ) #NEWLINE# assert ( 'foo' in l . functions ) #NEWLINE# assert ( 'bar123_xyz' in l . functions ) #NEWLINE# assert ( 'baz' in l . functions ) #NEWLINE# self . assertEqual ( len ( l . functions . keys ( ) ) , 5 ) #NEWLINE# assert ( 'a' in l . functions [ 'foo' ] . parameters ) #NEWLINE# assert ( 'b' in l . functions [ 'foo' ] . parameters ) #NEWLINE# assert ( 'c' in l . functions [ 'foo' ] . parameters ) #NEWLINE# self . assertEqual ( l . functions [ 'foo' ] . parameters [ 'a' ] . type . declaration , 'int' ) #NEWLINE# self . assertEqual ( l . functions [ 'foo' ] . parameters [ 'b' ] . type . declaration , 'int' ) #NEWLINE# self . assertEqual ( l . functions [ 'foo' ] . parameters [ 'c' ] . type . declaration , 'int' ) #NEWLINE# assert ( 'a' in l . functions [ 'bar123_xyz' ] . parameters ) #NEWLINE# assert ( 'b' in l . functions [ 'bar123_xyz' ] . parameters ) #NEWLINE# assert ( 'c' in l . functions [ 'bar123_xyz' ] . parameters ) #NEWLINE# assert ( 'd' in l . functions [ 'bar123_xyz' ] . parameters ) #NEWLINE# self . assertEqual ( l . functions [ 'bar123_xyz' ] . parameters [ 'a' ] . type . declaration , 'int *' ) #NEWLINE# self . assertEqual ( l . functions [ 'bar123_xyz' ] . parameters [ 'b' ] . type . declaration , 'const float *' ) #NEWLINE# self . assertEqual ( l . functions [ 'bar123_xyz' ] . parameters [ 'c' ] . type . declaration , 'char' ) #NEWLINE# self . assertEqual ( l . functions [ 'bar123_xyz' ] . parameters [ 'c' ] . type . dimension , [ '16' ] ) #NEWLINE# self . assertEqual ( l . functions [ 'bar123_xyz' ] . parameters [ 'd' ] . type . declaration , 'uint32_t' ) #NEWLINE# self . assertEqual ( l . functions [ 'bar123_xyz' ] . parameters [ 'd' ] . type . dimension , [ 'C1' , 'C2' ] ) #NEWLINE# assert ( len ( l . functions [ 'noparams' ] . parameters ) == 0 ) #NEWLINE# self . assertEqual ( l . functions [ 'funcWithBody' ] . parameters [ 'foo' ] . type . declaration , 'int' ) #NEWLINE# self . assertEqual ( l . functions [ 'funcWithBody' ] . parameters [ 'bar' ] . type . declaration , 'int' )