Browse Source

pylibfdt: Add a test for use of uint32_t

Using the libfdt function without going through the Python Fdt class
requires use of the uint32_t type. Add a test that this works correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Simon Glass 8 years ago committed by David Gibson
parent
commit
50e5cd07f3
  1. 5
      tests/pylibfdt_tests.py

5
tests/pylibfdt_tests.py

@ -283,6 +283,11 @@ class PyLibfdtTests(unittest.TestCase): @@ -283,6 +283,11 @@ class PyLibfdtTests(unittest.TestCase):
self.assertEquals(-libfdt.BADPATH,
self.fdt.path_offset('missing', QUIET_ALL))

def testIntegers(self):
"""Check that integers can be passed and returned"""
self.assertEquals(0, libfdt.fdt_get_phandle(self.fdt._fdt, 0))
node2 = self.fdt.path_offset('/subnode@2')
self.assertEquals(0x2000, libfdt.fdt_get_phandle(self.fdt._fdt, node2))

if __name__ == "__main__":
unittest.main()

Loading…
Cancel
Save