Lines Matching refs:dt

49     dt = parse(dts[1:], include_path)
51 actual = str(dt)
55 return dt
466 actual = dt.label2prop[label].name
469 dt = verify_parse("""
510 actual_prop, actual_offset = dt.label2prop_offset[label]
516 dt = verify_parse("""
556 node = dt.get_node(path)
560 dt = verify_parse("""
819 phandle = dtlib.to_num(dt.root.props[prop].value[offset:offset + 4])
820 actual_name = dt.phandle2node[phandle].name
825 dt = parse("""
1021 dt = dtlib.DT("test.dts")
1022 assert str(dt) == """
1070 dt = dtlib.DT("test.dts", include_path=(subdir_1, subdir_2))
1079 assert str(dt) == expected_dt
1392 def verify_path_is(path, node_name, dt): argument
1396 node = dt.get_node(path)
1401 def verify_path_error(path, msg, dt): argument
1406 dt.get_node(path)
1411 dt = parse("""
1425 verify_path_is("/", "/", dt)
1426 verify_path_is("//", "/", dt)
1427 verify_path_is("///", "/", dt)
1428 verify_path_is("/foo", "foo", dt)
1429 verify_path_is("//foo", "foo", dt)
1430 verify_path_is("///foo", "foo", dt)
1431 verify_path_is("/foo/bar", "bar", dt)
1432 verify_path_is("//foo//bar", "bar", dt)
1433 verify_path_is("///foo///bar", "bar", dt)
1434 verify_path_is("/baz", "baz", dt)
1439 dt)
1443 dt)
1447 dt)
1451 dt)
1454 assert dt.has_node(path), f"path '{path}' does not exist"
1457 assert not dt.has_node(path), f"path '{path}' exists"
1469 dt = parse("""
1499 verify_path_is(alias, node_name, dt)
1500 assert alias in dt.alias2node
1501 assert dt.alias2node[alias].name == node_name, f"bad result for {alias}"
1506 verify_path_is("alias4/node5", "node5", dt)
1511 dt)
1563 actual = dt.root.props[prop].type
1566 dt = parse("""
1628 dt = parse(r"""
1669 actual = dt.root.props[prop].to_num(signed)
1675 dt.root.props[prop].to_num()
1707 actual = dt.root.props[prop].to_nums(signed)
1713 dt.root.props[prop].to_nums()
1737 actual = dt.root.props[prop].to_bytes()
1742 dt.root.props[prop].to_bytes()
1760 actual = dt.root.props[prop].to_string()
1765 dt.root.props[prop].to_string()
1787 actual = dt.root.props[prop].to_strings()
1792 dt.root.props[prop].to_strings()
1811 actual = dt.root.props[prop].to_node().path
1816 dt.root.props[prop].to_node()
1832 actual = [node.path for node in dt.root.props[prop].to_nodes()]
1837 dt.root.props[prop].to_nodes()
1857 actual = dt.root.props[prop].to_path().path
1862 dt.root.props[prop].to_path()
1879 actual = fn(dt.root.props[prop].value, length, signed)
2089 dt = verify_parse("""
2109 assert dt.memreserves == expected
2133 dt = parse(dts, include_path=("foo", "bar"))
2136 repr(dt))
2138 repr(dt.root.props["x"]))
2140 repr(dt.root.nodes["sub"]))
2142 dt = parse(dts, include_path=iter(("foo", "bar")))
2145 repr(dt))
2295 dt = parse('''
2302 assert dt.get_node('/aliases').props['foo'].to_string() == '/missing'
2339 dt = parse('''
2357 dt_copy = deepcopy(dt)
2358 assert dt_copy.filename == dt.filename
2362 assert root_copy is not dt.root
2364 assert root_copy.dt is dt_copy
2366 assert root_copy.labels is not dt.root.labels
2372 assert dt_copy.memreserves is not dt.memreserves
2377 assert rootprop_copy is not dt.root.props['rootprop']
2382 assert rootprop_copy.labels is not dt.root.props['rootprop'].labels
2388 dt.root.props['rootprop'].offset_labels
2393 assert node_copy is not dt.get_node('/node@1234')
2395 assert node_copy.labels is not dt.get_node('/node@1234').labels
2400 assert node_copy.props is not dt.get_node('/node@1234').props
2405 assert node_copy.dt is dt_copy
2409 assert subnode_copy is not dt.get_node('/node@1234/subnode')
2422 original = getattr(dt, attr_name)
2446 for node in dt.node_iter():
2452 dt = parse('''
2469 parent = dt.get_node('/parent')
2470 child = dt.get_node('/parent/child')
2472 dt.move_node(parent, '/newpath')
2477 assert child.parent is dt.get_node('/newpath')
2478 assert dt.get_node('parent-alias') is parent
2479 assert dt.label2node['parent_label'] is parent
2481 assert not dt.has_node('/chosen')
2482 dt.move_node(dt.get_node('/bar/shouldbechosen'), '/chosen')
2483 assert dt.has_node('/chosen')
2484 assert 'foo' in dt.get_node('/chosen').props
2487 dt.move_node(dt.root, '/somewhere/else')
2491 dt.move_node(parent, '/aliases')
2494 dt.move_node(parent, 'xyz')
2497 dt.move_node(parent, '/ invalid')
2501 dt.move_node(parent, '/foo/bar')