summaryrefslogtreecommitdiff
path: root/tools/dtoc/test_dtoc.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-09 06:36:17 +0300
committerSimon Glass <sjg@chromium.org>2020-12-13 17:58:17 +0300
commit5ea9dccf02eb26d146dbc1fdb3106135612820ae (patch)
tree0ab49a5e6f160873d22cfdedc1feef38be990990 /tools/dtoc/test_dtoc.py
parentddaa94978583d07ec515e7226e397221d8cc44c8 (diff)
downloadu-boot-5ea9dccf02eb26d146dbc1fdb3106135612820ae.tar.xz
fdt: Use an Enum for the data type
Use an Enum instead of the current ad-hoc constants, so that there is a data type associated with each 'type' value. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/test_dtoc.py')
-rwxr-xr-xtools/dtoc/test_dtoc.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index a5836e04b7..6dd8a5ca47 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -134,13 +134,13 @@ class TestDtoc(unittest.TestCase):
def test_get_value(self):
"""Test operation of get_value() function"""
self.assertEqual('0x45',
- get_value(fdt.TYPE_INT, struct.pack('>I', 0x45)))
+ get_value(fdt.Type.INT, struct.pack('>I', 0x45)))
self.assertEqual('0x45',
- get_value(fdt.TYPE_BYTE, struct.pack('<I', 0x45)))
+ get_value(fdt.Type.BYTE, struct.pack('<I', 0x45)))
self.assertEqual('0x0',
- get_value(fdt.TYPE_BYTE, struct.pack('>I', 0x45)))
- self.assertEqual('"test"', get_value(fdt.TYPE_STRING, 'test'))
- self.assertEqual('true', get_value(fdt.TYPE_BOOL, None))
+ get_value(fdt.Type.BYTE, struct.pack('>I', 0x45)))
+ self.assertEqual('"test"', get_value(fdt.Type.STRING, 'test'))
+ self.assertEqual('true', get_value(fdt.Type.BOOL, None))
def test_get_compat_name(self):
"""Test operation of get_compat_name() function"""