Simplify arm reloc test file
authorEli Bendersky <eliben@gmail.com>
Wed, 5 Sep 2018 12:35:33 +0000 (05:35 -0700)
committerEli Bendersky <eliben@gmail.com>
Wed, 5 Sep 2018 12:35:33 +0000 (05:35 -0700)
test_arm_call_reloc.py

index cb524198811f3ad1ae43bb45bfe31975d6c6ac5a..8a2eac54dfed25487eb333767ae9fbc90888cdd5 100755 (executable)
@@ -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())