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)
Beispiel #2
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)
Beispiel #3
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)
 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)
Beispiel #5
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)
 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)