summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>2020-08-31 12:58:19 +0300
committerSimon Glass <sjg@chromium.org>2020-09-22 12:50:43 -0600
commit3fdeb14d951b28fa18494b4c3f819ad33b5fcc09 (patch)
tree52363fd0590e1115ffbd41eee6d530f2e75c952b /tools/binman/ftest.py
parent8001d0b162183493ee31b9e578756e450f673745 (diff)
binman: Respect pad-before property of section subentries
Other relevant properties (pad-after, offset, size, align, align-size, align-end) already work since Pack() sets correct ranges for subentries' data (.offset, .size variables), but some padding here is necessary to align the data within this range to match the pad-before property. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index ab88ee96ab4..53da709d513 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -3483,5 +3483,13 @@ class TestFunctional(unittest.TestCase):
expected = (U_BOOT_DATA + U_BOOT_DATA)
self.assertEqual(expected, data)
+ def testPadInSections(self):
+ """Test pad-before, pad-after for entries in sections"""
+ data = self._DoReadFile('166_pad_in_sections.dts')
+ expected = (U_BOOT_DATA + tools.GetBytes(ord('!'), 12) +
+ U_BOOT_DATA + tools.GetBytes(ord('!'), 6) +
+ U_BOOT_DATA)
+ self.assertEqual(expected, data)
+
if __name__ == "__main__":
unittest.main()