aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.tests6
-rw-r--r--tests/fdtoverlay-runtest.sh40
-rw-r--r--tests/include7.dts1
-rw-r--r--tests/path-references.c12
-rw-r--r--tests/path-references.dts13
-rw-r--r--tests/pylibfdt_tests.py288
-rwxr-xr-xtests/run_tests.sh61
-rw-r--r--tests/sw_tree1.c5
-rw-r--r--tests/test_tree1.dts1
-rw-r--r--tests/test_tree1_label_noderef.dts1
-rw-r--r--tests/tests.sh1
-rw-r--r--tests/trees.S2
-rw-r--r--tests/unit-addr-leading-0s.dts12
-rw-r--r--tests/unit-addr-leading-0x.dts12
14 files changed, 448 insertions, 7 deletions
diff --git a/tests/Makefile.tests b/tests/Makefile.tests
index 3d7a4f8..2258135 100644
--- a/tests/Makefile.tests
+++ b/tests/Makefile.tests
@@ -72,13 +72,13 @@ tests_clean:
rm -f $(STD_CLEANFILES:%=$(TESTS_PREFIX)%)
rm -f $(TESTS_CLEANFILES)
-check: tests ${TESTS_BIN}
+check: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
cd $(TESTS_PREFIX); ./run_tests.sh
-checkm: tests ${TESTS_BIN}
+checkm: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
cd $(TESTS_PREFIX); ./run_tests.sh -m 2>&1 | tee vglog.$$$$
-checkv: tests ${TESTS_BIN}
+checkv: tests ${TESTS_BIN} $(TESTS_PYLIBFDT)
cd $(TESTS_PREFIX); ./run_tests.sh -v
ifneq ($(DEPTARGETS),)
diff --git a/tests/fdtoverlay-runtest.sh b/tests/fdtoverlay-runtest.sh
new file mode 100644
index 0000000..06c1169
--- /dev/null
+++ b/tests/fdtoverlay-runtest.sh
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+# Run script for fdtoverlay tests
+# We run fdtoverlay to generate a target device tree, thn fdtget to check it
+
+# Usage
+# fdtoverlay-runtest.sh name expected_output dtb_file node property flags value
+
+. ./tests.sh
+
+LOG=tmp.log.$$
+EXPECT=tmp.expect.$$
+rm -f $LOG $EXPECT
+trap "rm -f $LOG $EXPECT" 0
+
+expect="$1"
+echo $expect >$EXPECT
+node="$2"
+property="$3"
+flags="$4"
+basedtb="$5"
+targetdtb="$6"
+shift 6
+overlays="$@"
+
+# First run fdtoverlay
+verbose_run_check $VALGRIND "$FDTOVERLAY" -i "$basedtb" -o "$targetdtb" $overlays
+
+# Now fdtget to read the value
+verbose_run_log_check "$LOG" $VALGRIND "$DTGET" "$targetdtb" "$node" "$property" $flags
+
+if cmp $EXPECT $LOG >/dev/null; then
+ PASS
+else
+ if [ -z "$QUIET_TEST" ]; then
+ echo "EXPECTED :-:"
+ cat $EXPECT
+ fi
+ FAIL "Results differ from expected"
+fi
diff --git a/tests/include7.dts b/tests/include7.dts
index 2f6eb89..ab2c948 100644
--- a/tests/include7.dts
+++ b/tests/include7.dts
@@ -5,6 +5,7 @@
subsubnode {
compatible = "subsubnode1", "subsubnode";
+ placeholder = "this is a placeholder string", "string2";
prop-int = <0xdeadbeef>;
};
diff --git a/tests/path-references.c b/tests/path-references.c
index c8d25fb..5e332e8 100644
--- a/tests/path-references.c
+++ b/tests/path-references.c
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
void *fdt;
const char *p;
int len, multilen;
- int n1, n2;
+ int n1, n2, n3, n4;
test_init(argc, argv);
fdt = load_blob_arg(argc, argv);
@@ -92,6 +92,16 @@ int main(int argc, char *argv[])
if ((!streq(p, "/node1") || !streq(p + strlen("/node1") + 1, "/node2")))
FAIL("multiref has wrong value");
+ /* Check reference to nested nodes with common prefix */
+ n3 = fdt_path_offset(fdt, "/foo/baz");
+ if (n3 < 0)
+ FAIL("fdt_path_offset(/foo/baz): %s", fdt_strerror(n3));
+ n4 = fdt_path_offset(fdt, "/foobar/baz");
+ if (n4 < 0)
+ FAIL("fdt_path_offset(/foobar/baz): %s", fdt_strerror(n4));
+ check_ref(fdt, n3, "/foobar/baz");
+ check_ref(fdt, n4, "/foo/baz");
+
check_rref(fdt);
PASS();
diff --git a/tests/path-references.dts b/tests/path-references.dts
index b00fd79..8c66d80 100644
--- a/tests/path-references.dts
+++ b/tests/path-references.dts
@@ -12,4 +12,17 @@
ref = &{/node1}; /* reference after target */
lref = &n1;
};
+ /* Check references to nested nodes with common prefix */
+ foobar {
+ n3: baz {
+ ref = &{/foo/baz};
+ lref = &n4;
+ };
+ };
+ foo {
+ n4: baz {
+ ref = &{/foobar/baz};
+ lref = &n3;
+ };
+ };
};
diff --git a/tests/pylibfdt_tests.py b/tests/pylibfdt_tests.py
new file mode 100644
index 0000000..ae392bb
--- /dev/null
+++ b/tests/pylibfdt_tests.py
@@ -0,0 +1,288 @@
+# pylibfdt - Tests for Flat Device Tree manipulation in Python
+# Copyright (C) 2017 Google, Inc.
+# Written by Simon Glass <sjg@chromium.org>
+#
+# libfdt is dual licensed: you can use it either under the terms of
+# the GPL, or the BSD license, at your option.
+#
+# a) This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Alternatively,
+#
+# b) Redistribution and use in source and binary forms, with or
+# without modification, are permitted provided that the following
+# conditions are met:
+#
+# 1. Redistributions of source code must retain the above
+# copyright notice, this list of conditions and the following
+# disclaimer.
+# 2. Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+import sys
+import types
+import unittest
+
+sys.path.append('../pylibfdt')
+import libfdt
+from libfdt import FdtException, QUIET_NOTFOUND, QUIET_ALL
+
+def get_err(err_code):
+ """Convert an error code into an error message
+
+ Args:
+ err_code: Error code value (FDT_ERR_...)
+
+ Returns:
+ String error code
+ """
+ return 'pylibfdt error %d: %s' % (-err_code, libfdt.fdt_strerror(-err_code))
+
+def _ReadFdt(fname):
+ """Read a device tree file into an Fdt object, ready for use
+
+ Args:
+ fname: Filename to read from
+
+ Returns:
+ Fdt bytearray suitable for passing to libfdt functions
+ """
+ return libfdt.Fdt(open(fname).read())
+
+class PyLibfdtTests(unittest.TestCase):
+ """Test class for pylibfdt
+
+ Properties:
+ fdt: Device tree file used for testing
+ """
+
+ def setUp(self):
+ """Read in the device tree we use for testing"""
+ self.fdt = _ReadFdt('test_tree1.dtb')
+
+ def GetPropList(self, node_path):
+ """Read a list of properties from a node
+
+ Args:
+ node_path: Full path to node, e.g. '/subnode@1/subsubnode'
+
+ Returns:
+ List of property names for that node, e.g. ['compatible', 'reg']
+ """
+ prop_list = []
+ node = self.fdt.path_offset(node_path)
+ poffset = self.fdt.first_property_offset(node, QUIET_NOTFOUND)
+ while poffset > 0:
+ prop = self.fdt.get_property_by_offset(poffset)
+ prop_list.append(prop.name)
+ poffset = self.fdt.next_property_offset(poffset, QUIET_NOTFOUND)
+ return prop_list
+
+ def testImport(self):
+ """Check that we can import the library correctly"""
+ self.assertEquals(type(libfdt), types.ModuleType)
+
+ def testBadFdt(self):
+ """Check that a filename provided accidentally is not accepted"""
+ with self.assertRaises(FdtException) as e:
+ fdt = libfdt.Fdt('a string')
+ self.assertEquals(e.exception.err, -libfdt.BADMAGIC)
+
+ def testPathOffset(self):
+ """Check that we can find the offset of a node"""
+ self.assertEquals(self.fdt.path_offset('/'), 0)
+ self.assertTrue(self.fdt.path_offset('/subnode@1') > 0)
+ with self.assertRaises(FdtException) as e:
+ self.fdt.path_offset('/wibble')
+ self.assertEquals(e.exception.err, -libfdt.NOTFOUND)
+ self.assertEquals(self.fdt.path_offset('/wibble', QUIET_NOTFOUND),
+ -libfdt.NOTFOUND)
+
+ def testPropertyOffset(self):
+ """Walk through all the properties in the root node"""
+ offset = self.fdt.first_property_offset(0)
+ self.assertTrue(offset > 0)
+ for i in range(5):
+ next_offset = self.fdt.next_property_offset(offset)
+ self.assertTrue(next_offset > offset)
+ offset = next_offset
+ self.assertEquals(self.fdt.next_property_offset(offset, QUIET_NOTFOUND),
+ -libfdt.NOTFOUND)
+
+ def testPropertyOffsetExceptions(self):
+ """Check that exceptions are raised as expected"""
+ with self.assertRaises(FdtException) as e:
+ self.fdt.first_property_offset(107)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+
+ # Quieten the NOTFOUND exception and check that a BADOFFSET
+ # exception is still raised.
+ with self.assertRaises(FdtException) as e:
+ self.fdt.first_property_offset(107, QUIET_NOTFOUND)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+ with self.assertRaises(FdtException) as e:
+ self.fdt.next_property_offset(107, QUIET_NOTFOUND)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+
+ # Check that NOTFOUND can be quietened.
+ node = self.fdt.path_offset('/subnode@1/ss1')
+ self.assertEquals(self.fdt.first_property_offset(node, QUIET_NOTFOUND),
+ -libfdt.NOTFOUND)
+ with self.assertRaises(FdtException) as e:
+ self.fdt.first_property_offset(node)
+ self.assertEquals(e.exception.err, -libfdt.NOTFOUND)
+
+ def testGetName(self):
+ """Check that we can get the name of a node"""
+ self.assertEquals(self.fdt.get_name(0), '')
+ node = self.fdt.path_offset('/subnode@1/subsubnode')
+ self.assertEquals(self.fdt.get_name(node), 'subsubnode')
+
+ with self.assertRaises(FdtException) as e:
+ self.fdt.get_name(-2)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+
+ def testGetPropertyByOffset(self):
+ """Check that we can read the name and contents of a property"""
+ root = 0
+ poffset = self.fdt.first_property_offset(root)
+ prop = self.fdt.get_property_by_offset(poffset)
+ self.assertEquals(prop.name, 'compatible')
+ self.assertEquals(prop.value, 'test_tree1\0')
+
+ with self.assertRaises(FdtException) as e:
+ self.fdt.get_property_by_offset(-2)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+ self.assertEquals(
+ -libfdt.BADOFFSET,
+ self.fdt.get_property_by_offset(-2, [libfdt.BADOFFSET]))
+
+ def testGetProp(self):
+ """Check that we can read the contents of a property by name"""
+ root = self.fdt.path_offset('/')
+ value = self.fdt.getprop(root, "compatible")
+ self.assertEquals(value, 'test_tree1\0')
+ self.assertEquals(-libfdt.NOTFOUND, self.fdt.getprop(root, 'missing',
+ QUIET_NOTFOUND))
+
+ with self.assertRaises(FdtException) as e:
+ self.fdt.getprop(root, 'missing')
+ self.assertEquals(e.exception.err, -libfdt.NOTFOUND)
+
+ node = self.fdt.path_offset('/subnode@1/subsubnode')
+ value = self.fdt.getprop(node, "compatible")
+ self.assertEquals(value, 'subsubnode1\0subsubnode\0')
+
+ def testStrError(self):
+ """Check that we can get an error string"""
+ self.assertEquals(libfdt.strerror(-libfdt.NOTFOUND),
+ 'FDT_ERR_NOTFOUND')
+
+ def testFirstNextSubnodeOffset(self):
+ """Check that we can walk through subnodes"""
+ node_list = []
+ node = self.fdt.first_subnode(0, QUIET_NOTFOUND)
+ while node >= 0:
+ node_list.append(self.fdt.get_name(node))
+ node = self.fdt.next_subnode(node, QUIET_NOTFOUND)
+ self.assertEquals(node_list, ['subnode@1', 'subnode@2'])
+
+ def testFirstNextSubnodeOffsetExceptions(self):
+ """Check except handling for first/next subnode functions"""
+ node = self.fdt.path_offset('/subnode@1/subsubnode', QUIET_NOTFOUND)
+ self.assertEquals(self.fdt.first_subnode(node, QUIET_NOTFOUND),
+ -libfdt.NOTFOUND)
+ with self.assertRaises(FdtException) as e:
+ self.fdt.first_subnode(node)
+ self.assertEquals(e.exception.err, -libfdt.NOTFOUND)
+
+ node = self.fdt.path_offset('/subnode@1/ss1', QUIET_NOTFOUND)
+ self.assertEquals(self.fdt.next_subnode(node, QUIET_NOTFOUND),
+ -libfdt.NOTFOUND)
+ with self.assertRaises(FdtException) as e:
+ self.fdt.next_subnode(node)
+ self.assertEquals(e.exception.err, -libfdt.NOTFOUND)
+
+ def testDeleteProperty(self):
+ """Test that we can delete a property"""
+ node_name = '/subnode@1'
+ self.assertEquals(self.GetPropList(node_name),
+ ['compatible', 'reg', 'prop-int'])
+ node = self.fdt.path_offset('/%s' % node_name)
+ self.assertEquals(self.fdt.delprop(node, 'reg'), 0)
+ self.assertEquals(self.GetPropList(node_name),
+ ['compatible', 'prop-int'])
+
+ def testHeader(self):
+ """Test that we can access the header values"""
+ self.assertEquals(self.fdt.totalsize(), len(self.fdt._fdt))
+ self.assertEquals(self.fdt.off_dt_struct(), 88)
+
+ def testPack(self):
+ """Test that we can pack the tree after deleting something"""
+ orig_size = self.fdt.totalsize()
+ node = self.fdt.path_offset('/subnode@2', QUIET_NOTFOUND)
+ self.assertEquals(self.fdt.delprop(node, 'prop-int'), 0)
+ self.assertEquals(orig_size, self.fdt.totalsize())
+ self.assertEquals(self.fdt.pack(), 0)
+ self.assertTrue(self.fdt.totalsize() < orig_size)
+
+ def testBadPropertyOffset(self):
+ """Test that bad property offsets are detected"""
+ with self.assertRaises(FdtException) as e:
+ self.fdt.get_property_by_offset(13)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+ with self.assertRaises(FdtException) as e:
+ self.fdt.first_property_offset(3)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+ with self.assertRaises(FdtException) as e:
+ self.fdt.next_property_offset(3)
+ self.assertEquals(e.exception.err, -libfdt.BADOFFSET)
+
+ def testBadPathOffset(self):
+ """Test that bad path names are detected"""
+ with self.assertRaisesRegexp(FdtException, get_err(libfdt.BADPATH)):
+ self.fdt.path_offset('not-present')
+
+ def testQuietAll(self):
+ """Check that exceptions can be masked by QUIET_ALL"""
+ self.assertEquals(-libfdt.NOTFOUND,
+ self.fdt.path_offset('/missing', QUIET_ALL))
+ self.assertEquals(-libfdt.BADOFFSET,
+ self.fdt.get_property_by_offset(13, QUIET_ALL))
+ self.assertEquals(-libfdt.BADPATH,
+ self.fdt.path_offset('missing', QUIET_ALL))
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index ed489db..b8a2825 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -157,7 +157,15 @@ run_fdtdump_test() {
file="$1"
shorten_echo fdtdump-runtest.sh "$file"
printf ": "
- base_run_test sh fdtdump-runtest.sh "$file"
+ base_run_test sh fdtdump-runtest.sh "$file" 2>/dev/null
+}
+
+run_fdtoverlay_test() {
+ expect="$1"
+ shift
+ shorten_echo fdtoverlay-runtest.sh "$expect" "$@"
+ printf ": "
+ base_run_test sh fdtoverlay-runtest.sh "$expect" "$@"
}
BAD_FIXUP_TREES="bad_index \
@@ -420,7 +428,7 @@ dtc_tests () {
run_dtc_test -I dts -O dtb -o dtc_path-references.test.dtb path-references.dts
run_test path-references dtc_path-references.test.dtb
- run_test phandle_format dtc_references.test.dtb both
+ run_test phandle_format dtc_references.test.dtb epapr
for f in legacy epapr both; do
run_dtc_test -I dts -O dtb -H $f -o dtc_references.test.$f.dtb references.dts
run_test phandle_format dtc_references.test.$f.dtb $f
@@ -540,6 +548,8 @@ dtc_tests () {
check_tests obsolete-chosen-interrupt-controller.dts obsolete_chosen_interrupt_controller
check_tests reg-without-unit-addr.dts unit_address_vs_reg
check_tests unit-addr-without-reg.dts unit_address_vs_reg
+ check_tests unit-addr-leading-0x.dts unit_address_format
+ check_tests unit-addr-leading-0s.dts unit_address_format
run_sh_test dtc-checkfails.sh node_name_chars -- -I dtb -O dtb bad_node_char.dtb
run_sh_test dtc-checkfails.sh node_name_format -- -I dtb -O dtb bad_node_format.dtb
run_sh_test dtc-checkfails.sh prop_name_chars -- -I dtb -O dtb bad_prop_char.dtb
@@ -769,6 +779,40 @@ fdtdump_tests () {
run_fdtdump_test fdtdump.dts
}
+fdtoverlay_tests() {
+ base=overlay_base.dts
+ basedtb=overlay_base.fdoverlay.test.dtb
+ overlay=overlay_overlay_manual_fixups.dts
+ overlaydtb=overlay_overlay_manual_fixups.fdoverlay.test.dtb
+ targetdtb=target.fdoverlay.test.dtb
+
+ run_dtc_test -@ -I dts -O dtb -o $basedtb $base
+ run_dtc_test -@ -I dts -O dtb -o $overlaydtb $overlay
+
+ # test that the new property is installed
+ run_fdtoverlay_test foobar "/test-node" "test-str-property" "-ts" ${basedtb} ${targetdtb} ${overlaydtb}
+}
+
+pylibfdt_tests () {
+ TMP=/tmp/tests.stderr.$$
+ python pylibfdt_tests.py -v 2> $TMP
+
+ # Use the 'ok' message meaning the test passed, 'ERROR' meaning it failed
+ # and the summary line for total tests (e.g. 'Ran 17 tests in 0.002s').
+ # We could add pass + fail to get total tests, but this provides a useful
+ # sanity check.
+ pass_count=$(grep "\.\.\. ok$" $TMP | wc -l)
+ fail_count=$(grep "^ERROR: " $TMP | wc -l)
+ total_tests=$(sed -n 's/^Ran \([0-9]*\) tests.*$/\1/p' $TMP)
+ cat $TMP
+ rm $TMP
+
+ # Extract the test results and add them to our totals
+ tot_fail=$((tot_fail + $fail_count))
+ tot_pass=$((tot_pass + $pass_count))
+ tot_tests=$((tot_tests + $total_tests))
+}
+
while getopts "vt:me" ARG ; do
case $ARG in
"v")
@@ -787,7 +831,12 @@ while getopts "vt:me" ARG ; do
done
if [ -z "$TESTSETS" ]; then
- TESTSETS="libfdt utilfdt dtc dtbs_equal fdtget fdtput fdtdump"
+ TESTSETS="libfdt utilfdt dtc dtbs_equal fdtget fdtput fdtdump fdtoverlay"
+
+ # Test pylibfdt if the libfdt Python module is available.
+ if [ -f ../pylibfdt/_libfdt.so ]; then
+ TESTSETS="$TESTSETS pylibfdt"
+ fi
fi
# Make sure we don't have stale blobs lying around
@@ -816,6 +865,12 @@ for set in $TESTSETS; do
"fdtdump")
fdtdump_tests
;;
+ "pylibfdt")
+ pylibfdt_tests
+ ;;
+ "fdtoverlay")
+ fdtoverlay_tests
+ ;;
esac
done
diff --git a/tests/sw_tree1.c b/tests/sw_tree1.c
index 4887dc3..6a338fc 100644
--- a/tests/sw_tree1.c
+++ b/tests/sw_tree1.c
@@ -85,6 +85,9 @@ int main(int argc, char *argv[])
size_t size;
int err;
bool created = false;
+ void *place;
+ const char place_str[] = "this is a placeholder string\0string2";
+ int place_len = sizeof(place_str);
test_init(argc, argv);
@@ -135,6 +138,8 @@ int main(int argc, char *argv[])
CHECK(fdt_begin_node(fdt, "subsubnode"));
CHECK(fdt_property(fdt, "compatible", "subsubnode1\0subsubnode",
23));
+ CHECK(fdt_property_placeholder(fdt, "placeholder", place_len, &place));
+ memcpy(place, place_str, place_len);
CHECK(fdt_property_cell(fdt, "prop-int", TEST_VALUE_1));
CHECK(fdt_end_node(fdt));
CHECK(fdt_begin_node(fdt, "ss1"));
diff --git a/tests/test_tree1.dts b/tests/test_tree1.dts
index 67ecfd0..77ea325 100644
--- a/tests/test_tree1.dts
+++ b/tests/test_tree1.dts
@@ -18,6 +18,7 @@
subsubnode {
compatible = "subsubnode1", "subsubnode";
+ placeholder = "this is a placeholder string", "string2";
prop-int = <0xdeadbeef>;
};
diff --git a/tests/test_tree1_label_noderef.dts b/tests/test_tree1_label_noderef.dts
index b2b194c..cfe5946 100644
--- a/tests/test_tree1_label_noderef.dts
+++ b/tests/test_tree1_label_noderef.dts
@@ -18,6 +18,7 @@
subsubnode {
compatible = "subsubnode1", "subsubnode";
+ placeholder = "this is a placeholder string", "string2";
prop-int = <0xdeadbeef>;
};
diff --git a/tests/tests.sh b/tests/tests.sh
index 818fd09..8dda6e1 100644
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -22,6 +22,7 @@ DTC=../dtc
DTGET=../fdtget
DTPUT=../fdtput
FDTDUMP=../fdtdump
+FDTOVERLAY=../fdtoverlay
verbose_run () {
if [ -z "$QUIET_TEST" ]; then
diff --git a/tests/trees.S b/tests/trees.S
index 3d24aa2..9854d1d 100644
--- a/tests/trees.S
+++ b/tests/trees.S
@@ -102,6 +102,7 @@ test_tree1_struct:
BEGIN_NODE("subsubnode")
PROP_STR(test_tree1, compatible, "subsubnode1\0subsubnode")
+ PROP_STR(test_tree1, placeholder, "this is a placeholder string\0string2")
PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
END_NODE
@@ -141,6 +142,7 @@ test_tree1_strings:
STRING(test_tree1, linux_phandle, "linux,phandle")
STRING(test_tree1, phandle, "phandle")
STRING(test_tree1, reg, "reg")
+ STRING(test_tree1, placeholder, "placeholder")
STRING(test_tree1, address_cells, "#address-cells")
STRING(test_tree1, size_cells, "#size-cells")
test_tree1_strings_end:
diff --git a/tests/unit-addr-leading-0s.dts b/tests/unit-addr-leading-0s.dts
new file mode 100644
index 0000000..cc017e9
--- /dev/null
+++ b/tests/unit-addr-leading-0s.dts
@@ -0,0 +1,12 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ bus {
+ node@001 {
+ reg = <1 0>;
+ };
+ };
+};
diff --git a/tests/unit-addr-leading-0x.dts b/tests/unit-addr-leading-0x.dts
new file mode 100644
index 0000000..74f1967
--- /dev/null
+++ b/tests/unit-addr-leading-0x.dts
@@ -0,0 +1,12 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ bus {
+ node@0x1 {
+ reg = <1 0>;
+ };
+ };
+};