Exemplo n.º 1
0
 def test_fix_rule_011(self):
     oRule = instantiation.rule_011()
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])
     # Note: the line below can change if this test is ran individually
     self.assertEqual(oFile.lines[76].line,
                      '      PORT_1(c_index)     => w_port_1,')
Exemplo n.º 2
0
    def test_rule_011(self):
        oRule = instantiation.rule_011()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '011')

        dExpected = [19,20,21,25,26,27,32,33,34,39,41,46,47,48,53,54,55,71,72]
        oRule.analyze(oFilePort)
        self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 3
0
 def test_fix_rule_011(self):
     oRule = instantiation.rule_011()
     oRule.case = 'upper'
     oRule.fix(oFile)
     oRule.analyze(oFile)
     self.assertEqual(oRule.violations, [])
     # Note: the line below can change if this test is ran individually
     self.assertEqual(oFile.lines[76].line,
                      '      PORT_1(c_index)     => w_port_1,')
     self.assertEqual(
         oFile.lines[114].line,
         '      I_PORTMAP_FORMAL    => I_ENTITY_INPUT(generate_loop_index)(function_call(G_GENERIC_A(generate_loop_index),8)-1 downto 0),'
     )
    def test_rule_011(self):
        oRule = instantiation.rule_011()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'instantiation')
        self.assertEqual(oRule.identifier, '011')

        dExpected = [{
            'line_number': 19,
            'words_to_fix': {'port_1'}
        }, {
            'line_number': 20,
            'words_to_fix': {'port_2'}
        }, {
            'line_number': 21,
            'words_to_fix': {'port_3'}
        }, {
            'line_number': 25,
            'words_to_fix': {'port_1'}
        }, {
            'line_number': 26,
            'words_to_fix': {'port_2'}
        }, {
            'line_number': 27,
            'words_to_fix': {'port_3'}
        }, {
            'line_number': 32,
            'words_to_fix': {'port_1'}
        }, {
            'line_number': 33,
            'words_to_fix': {'port_2'}
        }, {
            'line_number': 34,
            'words_to_fix': {'port_3'}
        }, {
            'line_number': 39,
            'words_to_fix': {'port_1'}
        }, {
            'line_number': 41,
            'words_to_fix': {'port_3'}
        }, {
            'line_number': 46,
            'words_to_fix': {'port_1'}
        }, {
            'line_number': 47,
            'words_to_fix': {'port_2'}
        }, {
            'line_number': 48,
            'words_to_fix': {'port_3'}
        }, {
            'line_number': 53,
            'words_to_fix': {'port_1'}
        }, {
            'line_number': 54,
            'words_to_fix': {'port_2'}
        }, {
            'line_number': 55,
            'words_to_fix': {'port_3'}
        }, {
            'line_number': 71,
            'words_to_fix': {'port_1'}
        }, {
            'line_number': 72,
            'words_to_fix': {'port_2'}
        }, {
            'line_number': 95,
            'words_to_fix': {'b'}
        }]
        oRule.analyze(oFilePort)
        self.assertEqual(oRule.violations, dExpected)
Exemplo n.º 5
0
 def test_rule_011(self):
     oRule = instantiation.rule_011()
     self.assertTrue(oRule)
     self.assertEqual(oRule.name, 'instantiation')
     self.assertEqual(oRule.identifier, '011')
     self.assertTrue(oRule.depricated)