Commit graph

8 commits

Author SHA1 Message Date
Rob Herring
c4ffc05574 tests: Replace license boilerplate with SPDX tags
Replace instances in tests of mostly LGPL-2.1 license boilerplate
with SPDX tags.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-5-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21 21:06:10 +10:00
David Gibson
0112fda03b libfdt: Add fdt_header_size()
We have a couple of places within libfdt and its tests where we need to
find the size of the header, based on the version.  Add a helper function
for it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-06-07 11:49:14 +10:00
Kim Phillips
38ad79d339 dtc/tests: don't include fdt.h prior to libfdt.h
tests will need fdt type definitions provided in a subsequent patch
to libfdt_env.h.  Since libfdt.h includes libfdt_env.h in the right
order anyway, just remove the fdt.h include.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2013-01-06 15:48:51 -06:00
David Gibson
716418849a dtc: Audit and fix valgrind errors
The somewhat embarrasing bug in the first version of my previous patch
would have been detected by valgrind.  Thus reminded, I've run the
testsuite under valgrind and fixed any errors I found.  This turned
out to be just some uninitialized buffers in test programs.  The
fragments of uninitialized data aren't particularly important, but we
might as well squash the valgrind warnings, so that future valgrind
errors will stand out.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2010-02-24 08:50:25 -06:00
David Gibson
01a2d8a3e9 dtc: Make many functions 'static'
This patch marks various functions not shared between c files
'static', as they should be.  There are a couple of functions in dtc,
and many in the testsuite.

This is *almost* enough to enable the -Wmissing-prototypes warning.
It's not quite enough, because there's a mess of junk in the flex
generated code which triggers that warning which I'm not yet sure how
to deal with.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-08-13 13:04:39 -05:00
David Gibson
36786db615 dtc: Enable and fix -Wpointer-arith warnings
This patch turns on the -Wpointer-arith option in the dtc Makefile,
and fixes the resulting warnings due to using (void *) in pointer
arithmetic.  While convenient, pointer arithmetic on void * is not
portable, so it's better that we avoid it, particularly in libfdt.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14 12:36:08 -05:00
David Gibson
7e14259791 dtc: Remove leftover debugging printf() from mangle-layout
The mangle-layout testcase/utility had a leftover debugging printf().
This patch removes it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-10-30 07:46:19 -05:00
David Gibson
3bef796b44 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>
2007-10-25 09:50:07 -05:00