コード例 #1
0
 def test_parse_typedefs_2(self):
     """parse_typedefs Unit test 2: One typedef"""
     input2 = '''
              typedef unsigned char u_int8;
              '''
     output2 = [{'type': 'unsigned char', 'name': 'u_int8'}]
     self.assertEqual(parse_typedefs(prepare_for_parsing(input2)), output2)
コード例 #2
0
ファイル: test_parse.py プロジェクト: maxeler/maxskins
 def test_parse_typedefs_2(self):
     """parse_typedefs Unit test 2: One typedef"""
     input2 = '''
              typedef unsigned char u_int8;
              '''
     output2 = [{'type' : 'unsigned char', 'name' : 'u_int8'}]
     self.assertEqual(parse_typedefs(prepare_for_parsing(input2)), output2)
コード例 #3
0
ファイル: test_parse.py プロジェクト: maxeler/maxskins
 def test_parse_typedefs_3(self):
     """parse_typedefs Unit test 3: Several typedefs"""
     input3 = '''
              typedef unsigned char u_int8;
              typedef unsigned char u_int8;
              '''
     output3 = [{'type' : 'unsigned char', 'name' : 'u_int8'},
                {'type' : 'unsigned char', 'name' : 'u_int8'}]
     self.assertEqual(parse_typedefs(prepare_for_parsing(input3)), output3)
コード例 #4
0
 def test_parse_typedefs_1(self):
     """parse_typedefs Unit test 1: No typedefs"""
     input1 = '''
              void  VectorAddition_writeLMem{
                     int64_t 		 param_address,
                     int64_t   param_nbytes,
                     const int32_t *instream_cpu_to_lmem};
              '''
     output1 = []
     self.assertEqual(parse_typedefs(prepare_for_parsing(input1)), output1)
コード例 #5
0
ファイル: test_parse.py プロジェクト: maxeler/maxskins
 def test_parse_typedefs_1(self):
     """parse_typedefs Unit test 1: No typedefs"""
     input1 = '''
              void  VectorAddition_writeLMem{
                     int64_t 		 param_address,
                     int64_t   param_nbytes,
                     const int32_t *instream_cpu_to_lmem};
              '''
     output1 = []
     self.assertEqual(parse_typedefs(prepare_for_parsing(input1)), output1)
コード例 #6
0
 def test_parse_typedefs_3(self):
     """parse_typedefs Unit test 3: Several typedefs"""
     input3 = '''
              typedef unsigned char u_int8;
              typedef unsigned char u_int8;
              '''
     output3 = [{
         'type': 'unsigned char',
         'name': 'u_int8'
     }, {
         'type': 'unsigned char',
         'name': 'u_int8'
     }]
     self.assertEqual(parse_typedefs(prepare_for_parsing(input3)), output3)