def test_copy(self): seg = DataElfSegment() new_seg = seg.copy() seg = SectionedElfSegment() seg.sections = [UnpreparedElfSection("test")] new_seg = seg.copy() seg = DataElfSegment() seg._data = ByteArray() new_seg = seg.copy() seg = DataElfSegment() seg.prepare(34) new_seg = seg.copy() seg = HeaderElfSegment() new_Seg = seg.copy()
def test_copy_into(self): elf_from = UnpreparedElfFile() elf_to = UnpreparedElfFile() seg = DataElfSegment(elf_from, ByteArray("pants")) new_seg = seg.copy_into(elf_to) seg = SectionedElfSegment(elf_from) seg.sections = [UnpreparedElfSection(elf_from, "test")] new_seg = seg.copy_into(elf_to) seg = DataElfSegment(elf_from, ByteArray("pants")) seg._data = ByteArray() new_seg = seg.copy_into(elf_to) seg = DataElfSegment(elf_from, ByteArray("pants")) seg.prepare(34) new_seg = seg.copy_into(elf_to) seg = HeaderElfSegment(elf_from) new_seg = seg.copy_into(elf_to)