diff options
author | Simon Glass <sjg@chromium.org> | 2019-05-17 22:00:40 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-07-10 16:52:58 -0600 |
commit | e66d318fef611241749d37b6b73ff80c84a8c866 (patch) | |
tree | eefa9361fd6b8191ad5aadde019d4a77e5361f5f /tools/dtoc | |
parent | 2ab6e13e014c065a6168d31d6b8aeca135767816 (diff) |
dtoc: Test full 64-bit properties with FdtCellsToCpu()
At present this test does not check the upper 32 bits of the returned
value. Add some additional tests to cover this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc')
-rwxr-xr-x | tools/dtoc/test_fdt.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index 4c39f9a3e2..a5234ce1e8 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -498,10 +498,17 @@ class TestFdtUtil(unittest.TestCase): self.assertEqual(2, fdt_util.fdt_cells_to_cpu(val, 1)) dtb2 = fdt.FdtScan('tools/dtoc/dtoc_test_addr64.dts') - node2 = dtb2.GetNode('/test1') - val = node2.props['reg'].value + node1 = dtb2.GetNode('/test1') + val = node1.props['reg'].value self.assertEqual(0x1234, fdt_util.fdt_cells_to_cpu(val, 2)) + node2 = dtb2.GetNode('/test2') + val = node2.props['reg'].value + self.assertEqual(0x1234567890123456, fdt_util.fdt_cells_to_cpu(val, 2)) + self.assertEqual(0x9876543210987654, fdt_util.fdt_cells_to_cpu(val[2:], + 2)) + self.assertEqual(0x12345678, fdt_util.fdt_cells_to_cpu(val, 1)) + def testEnsureCompiled(self): """Test a degenerate case of this function""" dtb = fdt_util.EnsureCompiled('tools/dtoc/dtoc_test_simple.dts') |