summaryrefslogtreecommitdiff
path: root/tools/dtoc/test_fdt.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-07-06 10:27:27 -0600
committerSimon Glass <sjg@chromium.org>2018-07-09 09:11:00 -0600
commit960662404f492e7088e5a91833dfb0c19ef5450e (patch)
treebb5b76adff977d885754d49a2966017794901db0 /tools/dtoc/test_fdt.py
parent117f57b75aee2e145d2d23107f600d869b04231a (diff)
dtoc: Drop use of a local dtb buffer
At present the Fdt class has its own copy of the device tree. This is confusing an unnecessary now that pylibfdt has its own. Drop it and provide access functions to the buffer. This allows us to move the rest of the implementation to use pylibfdt methods instead of directly calling libfdt stubs. 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, 2 insertions, 2 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index ba660ca9b7..daa9d128b5 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -72,7 +72,7 @@ class TestFdt(unittest.TestCase):
def testGetFdt(self):
"""Tetst that we can access the raw device-tree data"""
- self.assertTrue(isinstance(self.dtb.GetFdt(), bytearray))
+ self.assertTrue(isinstance(self.dtb.GetContents(), bytearray))
def testGetProps(self):
"""Tests obtaining a list of properties"""
@@ -157,7 +157,7 @@ class TestProp(unittest.TestCase):
# Add 12, which is sizeof(struct fdt_property), to get to start of data
offset = prop.GetOffset() + 12
- data = self.dtb._fdt[offset:offset + len(prop.value)]
+ data = self.dtb.GetContents()[offset:offset + len(prop.value)]
bytes = [chr(x) for x in data]
self.assertEqual(bytes, prop.value)