Commit 3f58268d by Thomas Barabosch

[Refactoring] Improves code quality of acceptance tests: use self.assertEqual…

[Refactoring] Improves code quality of acceptance tests: use self.assertEqual instead of plain asserts
parent c631bcfe
...@@ -11,25 +11,25 @@ class TestCwe190(unittest.TestCase): ...@@ -11,25 +11,25 @@ class TestCwe190(unittest.TestCase):
def test_cwe190_01_arm(self): def test_cwe190_01_arm(self):
expect_res = 3 expect_res = 3
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe190_01_x86(self): def test_cwe190_01_x86(self):
expect_res = 3 expect_res = 3
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe190_01_x64(self): def test_cwe190_01_x64(self):
expect_res = 3 expect_res = 3
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe190_01_mips(self): def test_cwe190_01_mips(self):
expect_res = 3 expect_res = 3
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe190_01_ppc(self): def test_cwe190_01_ppc(self):
expect_res = 3 expect_res = 3
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -12,24 +12,24 @@ class TestCwe215(unittest.TestCase): ...@@ -12,24 +12,24 @@ class TestCwe215(unittest.TestCase):
def test_cwe215_01_arm(self): def test_cwe215_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe215_01_x86(self): def test_cwe215_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe215_01_x64(self): def test_cwe215_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe215_01_ppc(self): def test_cwe215_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe215_01_mips(self): def test_cwe215_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.filename, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,52 +11,52 @@ class TestCwe243(unittest.TestCase): ...@@ -11,52 +11,52 @@ class TestCwe243(unittest.TestCase):
def test_cwe243_01_arm(self): def test_cwe243_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe243_01_x86(self): def test_cwe243_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe243_01_x64(self): def test_cwe243_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe243_01_ppc(self): def test_cwe243_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe243_01_mips(self): def test_cwe243_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe243_02_arm(self): def test_cwe243_02_arm(self):
expect_res = 0 expect_res = 0
res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Investigate and fix this issue") @unittest.skip("Investigate and fix this issue")
def test_cwe243_02_x86(self): def test_cwe243_02_x86(self):
expect_res = 0 expect_res = 0
res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe243_02_x64(self): def test_cwe243_02_x64(self):
expect_res = 0 expect_res = 0
res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe243_02_ppc(self): def test_cwe243_02_ppc(self):
expect_res = 0 expect_res = 0
res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe476_02_mips(self): def test_cwe476_02_mips(self):
expect_res = 0 expect_res = 0
res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target + "_clean", self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,26 +11,26 @@ class TestCwe248(unittest.TestCase): ...@@ -11,26 +11,26 @@ class TestCwe248(unittest.TestCase):
def test_cwe248_01_arm(self): def test_cwe248_01_arm(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Fix CPP compilation issue for x86") @unittest.skip("Fix CPP compilation issue for x86")
def test_cwe248_01_x86(self): def test_cwe248_01_x86(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe248_01_x64(self): def test_cwe248_01_x64(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe248_01_mips(self): def test_cwe248_01_mips(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe248_01_ppc(self): def test_cwe248_01_ppc(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,25 +11,25 @@ class TestCwe332(unittest.TestCase): ...@@ -11,25 +11,25 @@ class TestCwe332(unittest.TestCase):
def test_cwe332_01_arm(self): def test_cwe332_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe332_01_x86(self): def test_cwe332_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe332_01_x64(self): def test_cwe332_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe332_01_mips(self): def test_cwe332_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe332_01_ppc(self): def test_cwe332_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,25 +11,25 @@ class TestCwe367(unittest.TestCase): ...@@ -11,25 +11,25 @@ class TestCwe367(unittest.TestCase):
def test_cwe367_01_arm(self): def test_cwe367_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe367_01_x86(self): def test_cwe367_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe367_01_x64(self): def test_cwe367_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe367_01_mips(self): def test_cwe367_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe367_01_ppc(self): def test_cwe367_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,25 +11,25 @@ class TestCwe415(unittest.TestCase): ...@@ -11,25 +11,25 @@ class TestCwe415(unittest.TestCase):
def test_cwe415_01_arm(self): def test_cwe415_01_arm(self):
expect_res = 5 expect_res = 5
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe415_01_x86(self): def test_cwe415_01_x86(self):
expect_res = 5 expect_res = 5
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe415_01_x64(self): def test_cwe415_01_x64(self):
expect_res = 9 expect_res = 9
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe415_01_mips(self): def test_cwe415_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe415_01_ppc(self): def test_cwe415_01_ppc(self):
expect_res = 3 expect_res = 3
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,25 +11,25 @@ class TestCwe416(unittest.TestCase): ...@@ -11,25 +11,25 @@ class TestCwe416(unittest.TestCase):
def test_cwe416_01_arm(self): def test_cwe416_01_arm(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe416_01_x86(self): def test_cwe416_01_x86(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe416_01_x64(self): def test_cwe416_01_x64(self):
expect_res = 4 expect_res = 4
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe416_01_mips(self): def test_cwe416_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe416_01_ppc(self): def test_cwe416_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_emulation_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,26 +11,26 @@ class TestCwe426(unittest.TestCase): ...@@ -11,26 +11,26 @@ class TestCwe426(unittest.TestCase):
def test_cwe426_01_arm(self): def test_cwe426_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("FIXME") @unittest.skip("FIXME")
def test_cwe426_01_x86(self): def test_cwe426_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe426_01_x64(self): def test_cwe426_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe426_01_mips(self): def test_cwe426_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe426_01_ppc(self): def test_cwe426_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -12,28 +12,28 @@ class TestCwe457(unittest.TestCase): ...@@ -12,28 +12,28 @@ class TestCwe457(unittest.TestCase):
def test_cwe457_01_arm(self): def test_cwe457_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("FIXME") @unittest.skip("FIXME")
def test_cwe457_01_x86(self): def test_cwe457_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("FIXME") @unittest.skip("FIXME")
def test_cwe457_01_x64(self): def test_cwe457_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe457_01_mips(self): def test_cwe457_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("FIXME") @unittest.skip("FIXME")
def test_cwe457_01_ppc(self): def test_cwe457_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,26 +11,26 @@ class TestCwe467(unittest.TestCase): ...@@ -11,26 +11,26 @@ class TestCwe467(unittest.TestCase):
def test_cwe467_01_arm(self): def test_cwe467_01_arm(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("FIXME") @unittest.skip("FIXME")
def test_cwe467_01_x86(self): def test_cwe467_01_x86(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe467_01_x64(self): def test_cwe467_01_x64(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe467_01_mips(self): def test_cwe467_01_mips(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe467_01_ppc(self): def test_cwe467_01_ppc(self):
expect_res = 2 expect_res = 2
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,26 +11,26 @@ class TestCwe476(unittest.TestCase): ...@@ -11,26 +11,26 @@ class TestCwe476(unittest.TestCase):
def test_cwe476_01_arm(self): def test_cwe476_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe476_01_x86(self): def test_cwe476_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe476_01_x64(self): def test_cwe476_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe476_01_mips(self): def test_cwe476_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Fix issue in CWE476 implementation to support PPC") @unittest.skip("Fix issue in CWE476 implementation to support PPC")
def test_cwe476_01_ppc(self): def test_cwe476_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,25 +11,25 @@ class TestCwe676(unittest.TestCase): ...@@ -11,25 +11,25 @@ class TestCwe676(unittest.TestCase):
def test_cwe676_01_arm(self): def test_cwe676_01_arm(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'arm', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe676_01_x86(self): def test_cwe676_01_x86(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x86', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe676_01_x64(self): def test_cwe676_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
@unittest.skip("Depends on proper MIPS support in BAP") @unittest.skip("Depends on proper MIPS support in BAP")
def test_cwe676_01_mips(self): def test_cwe676_01_mips(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'mips', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
def test_cwe676_01_ppc(self): def test_cwe676_01_ppc(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'ppc', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
...@@ -11,4 +11,4 @@ class TestCwe782(unittest.TestCase): ...@@ -11,4 +11,4 @@ class TestCwe782(unittest.TestCase):
def test_cwe782_01_x64(self): def test_cwe782_01_x64(self):
expect_res = 1 expect_res = 1
res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string) res = cwe_checker_testlib.execute_and_check_occurence(self.target, self.target, 'x64', self.string)
assert res == expect_res self.assertEqual(res, expect_res)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment