|
|
@ -221,9 +221,9 @@ class TestNamingConvention(unittest.TestCase): |
|
|
|
outFD4_lines[i] = outFD4_lines[i].strip() |
|
|
|
outFD4_lines[i] = outFD4_lines[i].strip() |
|
|
|
self.assertTrue(os.path.isfile(self.testFilePath4+".format"),"Patched .format file is not created?!") |
|
|
|
self.assertTrue(os.path.isfile(self.testFilePath4+".format"),"Patched .format file is not created?!") |
|
|
|
self.assertEqual(outFD4_lines[0],"Number of Slither results: 2") |
|
|
|
self.assertEqual(outFD4_lines[0],"Number of Slither results: 2") |
|
|
|
self.assertEqual(outFD4_lines[1],"Number of patches: 8") |
|
|
|
self.assertEqual(outFD4_lines[1],"Number of patches: 11") |
|
|
|
self.assertEqual(outFD4_lines.count("Detector: naming-convention (enum definition)"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("Detector: naming-convention (enum definition)"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("Detector: naming-convention (enum use)"), 6) |
|
|
|
self.assertEqual(outFD4_lines.count("Detector: naming-convention (enum use)"), 9) |
|
|
|
self.assertEqual(outFD4_lines.count("Old string: enum e {ONE, TWO}"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("Old string: enum e {ONE, TWO}"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("New string: enum E {ONE, TWO}"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("New string: enum E {ONE, TWO}"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 73"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 73"), 1) |
|
|
@ -236,18 +236,28 @@ class TestNamingConvention(unittest.TestCase): |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 129"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 129"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 478"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 478"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 482"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 482"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Old string: e eA"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Old string: e eA"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("New string: E eA"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("New string: E eA"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 549"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 549"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 553"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 553"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Old string: e e2 = eA"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 690"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("New string: E e2 = eA"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 694"), 1) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Old string: e e2 = eA"), 2) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("New string: E e2 = eA"), 2) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 573"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 573"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 582"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 582"), 1) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 714"), 1) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 723"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Old string: e.ONE"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Old string: e.ONE"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("New string: E.ONE"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("New string: E.ONE"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 186"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 186"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 192"), 1) |
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 192"), 1) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Old string: e"), 2) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("New string: E"), 2) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 564"), 1) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 565"), 1) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Location start: 705"), 1) |
|
|
|
|
|
|
|
self.assertEqual(outFD4_lines.count("Location end: 706"), 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_naming_convention_event(self): |
|
|
|
def test_naming_convention_event(self): |
|
|
|
outFD5 = open(self.testFilePath5+".out","r") |
|
|
|
outFD5 = open(self.testFilePath5+".out","r") |
|
|
|