diff options
Diffstat (limited to 'tools/binman/elf_test.py')
-rw-r--r-- | tools/binman/elf_test.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index f727258..47ebfba 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -27,7 +27,7 @@ class FakeEntry: """ def __init__(self, contents_size): self.contents_size = contents_size - self.data = tools.GetBytes(ord('a'), contents_size) + self.data = tools.get_bytes(ord('a'), contents_size) def GetPath(self): return 'entry_path' @@ -72,7 +72,7 @@ def BuildElfTestFiles(target_dir): if 'MAKEFLAGS' in os.environ: del os.environ['MAKEFLAGS'] try: - tools.Run('make', '-C', target_dir, '-f', + tools.run('make', '-C', target_dir, '-f', os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir) except ValueError as e: # The test system seems to suppress this in a strange way @@ -83,7 +83,7 @@ class TestElf(unittest.TestCase): @classmethod def setUpClass(cls): cls._indir = tempfile.mkdtemp(prefix='elf.') - tools.SetInputDirs(['.']) + tools.set_input_dirs(['.']) BuildElfTestFiles(cls._indir) @classmethod @@ -166,13 +166,13 @@ class TestElf(unittest.TestCase): section = FakeSection(sym_value=None) elf_fname = self.ElfTestFile('u_boot_binman_syms') syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) - self.assertEqual(tools.GetBytes(255, 20) + tools.GetBytes(ord('a'), 4), + self.assertEqual(tools.get_bytes(255, 20) + tools.get_bytes(ord('a'), 4), entry.data) def testDebug(self): """Check that enabling debug in the elf module produced debug output""" try: - tout.Init(tout.DEBUG) + tout.init(tout.DEBUG) entry = FakeEntry(20) section = FakeSection() elf_fname = self.ElfTestFile('u_boot_binman_syms') @@ -180,7 +180,7 @@ class TestElf(unittest.TestCase): syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertTrue(len(stdout.getvalue()) > 0) finally: - tout.Init(tout.WARNING) + tout.init(tout.WARNING) def testMakeElf(self): """Test for the MakeElf function""" @@ -193,9 +193,9 @@ class TestElf(unittest.TestCase): # Make an Elf file and then convert it to a fkat binary file. This # should produce the original data. elf.MakeElf(elf_fname, expected_text, expected_data) - objcopy, args = tools.GetTargetCompileTool('objcopy') + objcopy, args = tools.get_target_compile_tool('objcopy') args += ['-O', 'binary', elf_fname, bin_fname] - stdout = command.Output(objcopy, *args) + stdout = command.output(objcopy, *args) with open(bin_fname, 'rb') as fd: data = fd.read() self.assertEqual(expected_text + expected_data, data) @@ -210,7 +210,7 @@ class TestElf(unittest.TestCase): expected_data = b'wxyz' elf_fname = os.path.join(outdir, 'elf') elf.MakeElf(elf_fname, expected_text, expected_data) - data = tools.ReadFile(elf_fname) + data = tools.read_file(elf_fname) load = 0xfef20000 entry = load + 2 @@ -231,7 +231,7 @@ class TestElf(unittest.TestCase): offset = elf.GetSymbolFileOffset(fname, ['embed_start', 'embed_end']) start = offset['embed_start'].offset end = offset['embed_end'].offset - data = tools.ReadFile(fname) + data = tools.read_file(fname) embed_data = data[start:end] expect = struct.pack('<III', 0x1234, 0x5678, 0) self.assertEqual(expect, embed_data) |