Exemplo n.º 1
0
    def test_replace_section(self):
        seg = SectionedElfSegment(sections=[UnpreparedElfSection("test")])
        old_section = seg.get_sections()[0]
        new_section = UnpreparedElfSection("new")
        seg.replace_section(old_section, new_section)
        self.assertEqual(seg.get_sections(), [new_section])
        new_seg = seg.copy()

        self.assertRaises(InvalidArgument, seg.replace_section, None, new_section)
Exemplo n.º 2
0
    def test_replace_section(self):
        seg = SectionedElfSegment(sections=[UnpreparedElfSection("test")])
        old_section = seg.get_sections()[0]
        new_section = UnpreparedElfSection("new")
        seg.replace_section(old_section, new_section)
        self.assertEqual(seg.get_sections(), [new_section])
        new_seg = seg.copy()

        self.assertRaises(InvalidArgument, seg.replace_section, None,
                          new_section)