コード例 #1
0
 def test_rule_003(self):
     oRule = signal.rule_003()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'signal')
     self.assertEqual(oRule.identifier, '003')
     lExpected = utils.add_violation_list([8, 9, 12])
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, lExpected)
コード例 #2
0
 def test_rule_003(self):
     oRule = signal.rule_003()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'signal')
     self.assertEqual(oRule.identifier, '003')
     dExpected = [8, 9, 12]
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, dExpected)
コード例 #3
0
 def test_fix_rule_003(self):
     oRule = signal.rule_003()
     lExpected = []
     oRule.fix(self.oFile)
     oRule.analyze(self.oFile)
     self.assertEqual(self.oFile.lines[5].line, '  signal a_sig : std_logic_vector(31 downto 0);')
     self.assertEqual(self.oFile.lines[8].line, ' signal b_sig : std_logic_vector(31 downto 0);')
     self.assertEqual(self.oFile.lines[12].line, '  signal SIg : STD_LOGIC_VECTOR(31 downto 0);')
     self.assertEqual(oRule.violations, lExpected)
コード例 #4
0
    def test_rule_003_w_3_spaces(self):
        oRule = signal.rule_003()
        oRule.spaces = 3
        lExpected = []
        lExpected.extend(utils.add_violation_list(range(5, 12)))
        lExpected.extend(utils.add_violation_list(range(13, 17)))
        lExpected.extend(utils.add_violation_list(range(18, 22)))
        lExpected.append(utils.add_violation(23))

        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, lExpected)
コード例 #5
0
 def test_rule_003(self):
     oRule = signal.rule_003()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'signal')
     self.assertEqual(oRule.identifier, '003')
     self.assertTrue(oRule.depricated)
コード例 #6
0
 def test_fix_rule_003(self):
     oRule = signal.rule_003()
     dExpected = []
     oRule.fix(self.oFile)
     oRule.analyze(self.oFile)
     self.assertEqual(oRule.violations, dExpected)