Exemplo n.º 1
0
    def test_parse_supported_code_file(self):
        """This test is the depicts the solution to the pravious two tests.

        test_parse_unssupported_type_cfile and test_parse_include_bool_type_cfile erros.
        Before parse a cfile, two includes are inserted on it replaced the first two 
        includes from the original code, Then to conserve the bool type include, whe need
        to add two includes above it. 
        """
        ast = parser.parse_cfile(file_path=self._supported)
        self.assertIsInstance(ast,FileAST)
Exemplo n.º 2
0
 def test_parse_unsupported_code_file_2(self):
     with self.assertRaises(ParseError):
         ast = parser.parse_cfile(file_path=self._unsupported_2)
Exemplo n.º 3
0
 def test_parse_unsupported_code_file_1(self):
     # bool type is not supported nativelly in C99
     with self.assertRaises(ParseError):
         ast = parser.parse_cfile(file_path=self._unsupported_1)
Exemplo n.º 4
0
 def test_parse_empty_code_file(self):
     ast = parser.parse_cfile(file_path=self._empty)
     self.assertIsInstance(ast,FileAST)
Exemplo n.º 5
0
 def test_parse_complex_code_file(self):
     ast = parser.parse_cfile(file_path=self._complex)
     self.assertIsInstance(ast,FileAST)
Exemplo n.º 6
0
 def test_parse_basic_code_file(self):
     ast = parser.parse_cfile(file_path=self._basic)
     self.assertIsInstance(ast,FileAST)