summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 12:23:57 -0600
committerSimon Glass <sjg@chromium.org>2019-07-29 09:38:06 -0600
commit79d3c58d1268786ce40c6c0920ed2a447247fdc4 (patch)
tree309446efa8a5ccbde4024c312ac7342e7d27e3cc /tools/binman/ftest.py
parent51014aabc28e497eb98e0ba9c1fa0f19e871af1b (diff)
downloadu-boot-79d3c58d1268786ce40c6c0920ed2a447247fdc4.tar.gz
binman: Update the _testing entry to support shrinkage
Sometimes entries shrink after packing. As a start towards supporting this, update the _testing entry to handle the test case. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 64c6c0abae..f8568d7cda 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -1236,7 +1236,7 @@ class TestFunctional(unittest.TestCase):
state.SetAllowEntryExpansion(False)
with self.assertRaises(ValueError) as e:
self._DoReadFile('059_change_size.dts', True)
- self.assertIn("Node '/binman/_testing': Cannot update entry size from 1 to 2",
+ self.assertIn("Node '/binman/_testing': Cannot update entry size from 2 to 3",
str(e.exception))
finally:
state.SetAllowEntryExpansion(True)
@@ -1252,7 +1252,7 @@ class TestFunctional(unittest.TestCase):
'image-pos': 0,
'offset': 0,
'_testing:offset': 32,
- '_testing:size': 1,
+ '_testing:size': 2,
'_testing:image-pos': 32,
'section@0/u-boot:offset': 0,
'section@0/u-boot:size': len(U_BOOT_DATA),
@@ -2135,9 +2135,9 @@ class TestFunctional(unittest.TestCase):
def testEntryExpand(self):
"""Test expanding an entry after it is packed"""
data = self._DoReadFile('121_entry_expand.dts')
- self.assertEqual(b'aa', data[:2])
- self.assertEqual(U_BOOT_DATA, data[2:2 + len(U_BOOT_DATA)])
- self.assertEqual(b'aa', data[-2:])
+ self.assertEqual(b'aaa', data[:3])
+ self.assertEqual(U_BOOT_DATA, data[3:3 + len(U_BOOT_DATA)])
+ self.assertEqual(b'aaa', data[-3:])
def testEntryExpandBad(self):
"""Test expanding an entry after it is packed, twice"""
@@ -2149,9 +2149,9 @@ class TestFunctional(unittest.TestCase):
def testEntryExpandSection(self):
"""Test expanding an entry within a section after it is packed"""
data = self._DoReadFile('123_entry_expand_section.dts')
- self.assertEqual(b'aa', data[:2])
- self.assertEqual(U_BOOT_DATA, data[2:2 + len(U_BOOT_DATA)])
- self.assertEqual(b'aa', data[-2:])
+ self.assertEqual(b'aaa', data[:3])
+ self.assertEqual(U_BOOT_DATA, data[3:3 + len(U_BOOT_DATA)])
+ self.assertEqual(b'aaa', data[-3:])
def testCompressDtb(self):
"""Test that compress of device-tree files is supported"""