libfdt: Test on trees with different block layouts

At present, all the example dtbs we use in the testsuite are version
17 and have reservation map, then structure block then strings block
(the natural ordering based on alignment constraints).  However, all
libfdt's read-only and in-place write functions should also work on
v16 trees, and on trees with other layouts.

This patch adds a testcase / utility function to rearrange the blocks
of a dtb and/or regress a v17 tree to v16, and uses it to run tests on
trees with different layouts and versions.

Signed-off-by: David Gibson <david@tgibson.dropbear.id.au>
This commit is contained in:
David Gibson 2007-10-25 15:05:58 +10:00 committed by Jon Loeliger
parent 9b91134ba3
commit 3bef796b44
3 changed files with 178 additions and 1 deletions

View file

@ -78,6 +78,17 @@ libfdt_tests () {
tree1_tests deshunted.$tree
done
# v16 and alternate layout tests
for tree in test_tree1.dtb; do
for version in 17 16; do
for layout in mts mst tms tsm smt stm; do
run_test mangle-layout $tree $version $layout
tree1_tests v$version.$layout.$tree
run_test dtbs_equal_ordered $tree v$version.$layout.$tree
done
done
done
# Read-write tests
for tree in test_tree1.dtb sw_tree1.test.dtb; do
rm -f opened.$tree repacked.$tree