From e762568c490f26ed7f75afc6a48c339bd43b5689 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Wed, 5 Sep 2018 05:35:33 -0700 Subject: [PATCH] Simplify arm reloc test file --- test_arm_call_reloc.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test_arm_call_reloc.py b/test_arm_call_reloc.py index cb52419..8a2eac5 100755 --- a/test_arm_call_reloc.py +++ b/test_arm_call_reloc.py @@ -10,6 +10,7 @@ #------------------------------------------------------------------------------- import os import sys +import unittest from elftools.common.py3compat import BytesIO from elftools.elf.elffile import ELFFile @@ -25,11 +26,12 @@ def do_relocation(rel_elf): rel = rel_elf.get_section_by_name('.rel.text') rh.apply_section_relocations(stream, rel) + return data.getvalue() - stream.seek(0) - data = stream.readlines() + #stream.seek(0) + #data = stream.readlines() - return data + #return data class TestARMRElocation(unittest.TestCase): @@ -41,5 +43,5 @@ class TestARMRElocation(unittest.TestCase): elf = ELFFile(f) # Comparison of '.text' section data - self.assertEquals(do_relocation(rel_elf).pop(), + self.assertEquals(do_relocation(rel_elf), elf.get_section_by_name('.text').data()) -- 2.30.2