mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
binman: Add a prefix before CBFS hex offsets
Add a 0x prefix to these errors to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
513c53e445
commit
17a7421ff4
|
@ -715,7 +715,7 @@ class CbfsReader(object):
|
||||||
file_pos = fd.tell()
|
file_pos = fd.tell()
|
||||||
data = fd.read(FILE_HEADER_LEN)
|
data = fd.read(FILE_HEADER_LEN)
|
||||||
if len(data) < FILE_HEADER_LEN:
|
if len(data) < FILE_HEADER_LEN:
|
||||||
print('File header at %x ran out of data' % file_pos)
|
print('File header at %#x ran out of data' % file_pos)
|
||||||
return False
|
return False
|
||||||
magic, size, ftype, attr, offset = struct.unpack(FILE_HEADER_FORMAT,
|
magic, size, ftype, attr, offset = struct.unpack(FILE_HEADER_FORMAT,
|
||||||
data)
|
data)
|
||||||
|
@ -724,7 +724,7 @@ class CbfsReader(object):
|
||||||
pos = fd.tell()
|
pos = fd.tell()
|
||||||
name = self._read_string(fd)
|
name = self._read_string(fd)
|
||||||
if name is None:
|
if name is None:
|
||||||
print('String at %x ran out of data' % pos)
|
print('String at %#x ran out of data' % pos)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
|
|
@ -372,7 +372,7 @@ class TestCbfs(unittest.TestCase):
|
||||||
with io.BytesIO(newdata) as fd:
|
with io.BytesIO(newdata) as fd:
|
||||||
fd.seek(pos)
|
fd.seek(pos)
|
||||||
self.assertEqual(False, cbr._read_next_file(fd))
|
self.assertEqual(False, cbr._read_next_file(fd))
|
||||||
self.assertIn('File header at 0 ran out of data', stdout.getvalue())
|
self.assertIn('File header at 0x0 ran out of data', stdout.getvalue())
|
||||||
|
|
||||||
def test_cbfs_bad_file_string(self):
|
def test_cbfs_bad_file_string(self):
|
||||||
"""Check handling of an incomplete filename string"""
|
"""Check handling of an incomplete filename string"""
|
||||||
|
@ -394,7 +394,7 @@ class TestCbfs(unittest.TestCase):
|
||||||
with io.BytesIO(newdata) as fd:
|
with io.BytesIO(newdata) as fd:
|
||||||
fd.seek(pos)
|
fd.seek(pos)
|
||||||
self.assertEqual(False, cbr._read_next_file(fd))
|
self.assertEqual(False, cbr._read_next_file(fd))
|
||||||
self.assertIn('String at %x ran out of data' %
|
self.assertIn('String at %#x ran out of data' %
|
||||||
cbfs_util.FILE_HEADER_LEN, stdout.getvalue())
|
cbfs_util.FILE_HEADER_LEN, stdout.getvalue())
|
||||||
|
|
||||||
def test_cbfs_debug(self):
|
def test_cbfs_debug(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user