summaryrefslogtreecommitdiff
path: root/tools/dtoc/test_fdt.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-09 18:39:44 -0600
committerSimon Glass <sjg@chromium.org>2020-07-25 14:46:57 -0600
commitc06391790633e116c9dc6a63c1649b13d7adb34e (patch)
treeda7a4c6aa4fd99c9613843342b5e372edc6cbbf4 /tools/dtoc/test_fdt.py
parent152b246298bd5f107f5e08ddddee40411aa74cb7 (diff)
dtoc: Allow adding variable-sized data to a dtb
Add a method for adding a property containing arbitrary bytes. Make sure that the tree can expand as needed in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/test_fdt.py')
-rwxr-xr-xtools/dtoc/test_fdt.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index 375e906424..b4f9b7f498 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -417,6 +417,10 @@ class TestProp(unittest.TestCase):
self.node.SetData('empty', b'123')
self.assertEqual(b'123', prop.bytes)
+ # Trying adding a lot of data at once
+ self.node.AddData('data', tools.GetBytes(65, 20000))
+ self.dtb.Sync(auto_resize=True)
+
def testFromData(self):
dtb2 = fdt.Fdt.FromData(self.dtb.GetContents())
self.assertEqual(dtb2.GetContents(), self.dtb.GetContents())