diff options
| author | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2017-03-10 03:28:43 +0000 |
|---|---|---|
| committer | Oleksandr Tymoshenko <gonzo@FreeBSD.org> | 2017-03-10 03:28:43 +0000 |
| commit | f059bd1ebfc4cf2e96c4639ad7fa6cf3a3198a2f (patch) | |
| tree | 74d52c3db99ba80520d6142e9bc77e2802093021 /tests/references.c | |
| parent | b903311b940763cafe4fb3d8ab3da9c135c17b0c (diff) | |
Import dtc 1.4.3vendor/dtc/1.4.3
Notes
svn path=/vendor/dtc/dist/; revision=314985
svn path=/vendor/dtc/1.4.3/; revision=314986; tag=vendor/dtc/1.4.3
Diffstat (limited to 'tests/references.c')
| -rw-r--r-- | tests/references.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/references.c b/tests/references.c index c9d05a2f2962..46662fc0faa7 100644 --- a/tests/references.c +++ b/tests/references.c @@ -56,6 +56,23 @@ static void check_ref(const void *fdt, int node, uint32_t checkref) node, ref, checkref); } +static void check_rref(const void *fdt) +{ + const uint32_t *p; + uint32_t ref; + int len; + + p = fdt_getprop(fdt, 0, "rref", &len); + if (!p) + FAIL("fdt_getprop(0, \"rref\"): %s", fdt_strerror(len)); + if (len != sizeof(*p)) + FAIL("'rref' in root node has wrong size (%d instead of %zd)", + len, sizeof(*p)); + ref = fdt32_to_cpu(*p); + if (ref != fdt_get_phandle(fdt, 0)) + FAIL("'rref' in root node has value 0x%x instead of 0x0", ref); +} + int main(int argc, char *argv[]) { void *fdt; @@ -104,5 +121,7 @@ int main(int argc, char *argv[]) check_ref(fdt, n2, h1); check_ref(fdt, n3, h4); + check_rref(fdt); + PASS(); } |
