Ejemplo n.º 1
0
 def test_should_use_clang_format_for_warning(self):
     self.foo.cyclomatic_complexity = 30
     self.foo.max_nesting_depth = 10
     fileSummary = FileInformation("FILENAME", 123, [self.foo])
     scheme = OutputScheme([Ext()])
     count = print_clang_style_warning([fileSummary], self.option, scheme, None)
     self.assertIn("FILENAME:100: warning: foo has 1 NLOC, 30 CCN, 1 token, 0 PARAM, 0 length, 10 ND\n", sys.stdout.stream)
     self.assertEqual(1, count)
Ejemplo n.º 2
0
 def test_should_use_clang_format_for_warning(self):
     self.foo.cyclomatic_complexity = 30
     self.foo.max_nesting_depth = 10
     fileSummary = FileInformation("FILENAME", 123, [self.foo])
     scheme = OutputScheme([Ext()])
     count = print_clang_style_warning([fileSummary], self.option, scheme)
     self.assertIn("FILENAME:100: warning: foo has 1 NLOC, 30 CCN, 1 token, 0 PARAM, 0 length, 10 ND\n", sys.stdout.stream)
     self.assertEqual(1, count)
Ejemplo n.º 3
0
 def test_no_news_is_good_news(self):
     count = print_clang_style_warning([], self.option, None, None)
     self.assertEqual('', sys.stdout.stream)
     self.assertEqual(0, count)
Ejemplo n.º 4
0
 def test_no_news_is_good_news(self):
     count = print_clang_style_warning([], self.option, None, None)
     self.assertEqual('', sys.stdout.stream)
     self.assertEqual(0, count)
Ejemplo n.º 5
0
 def test_should_use_clang_format_for_warning(self):
     self.foo.cyclomatic_complexity = 30
     fileSummary = FileInformation("FILENAME", 123, [self.foo])
     print_clang_style_warning([fileSummary], self.option, None)
     self.assertIn("FILENAME:100: warning: foo has 30 CCN and 0 params (1 NLOC, 1 tokens)\n", sys.stdout.stream)
Ejemplo n.º 6
0
 def test_no_news_is_good_news(self):
     print_clang_style_warning([], self.option, None)
     self.assertEqual("", sys.stdout.stream)