diff options
Diffstat (limited to 'tests/tests.h')
-rw-r--r-- | tests/tests.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/tests/tests.h b/tests/tests.h index fcb2b2af6763..56a843cd25d8 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -93,22 +93,6 @@ void cleanup(void); exit(RC_BUG); \ } while (0) -static inline void *xmalloc(size_t size) -{ - void *p = malloc(size); - if (! p) - FAIL("malloc() failure"); - return p; -} - -static inline void *xrealloc(void *p, size_t size) -{ - p = realloc(p, size); - if (! p) - FAIL("realloc() failure"); - return p; -} - void check_mem_rsv(void *fdt, int n, uint64_t addr, uint64_t size); void check_property(void *fdt, int nodeoffset, const char *name, @@ -127,6 +111,11 @@ const void *check_getprop(void *fdt, int nodeoffset, const char *name, uint32_t x = cpu_to_fdt32(val); \ check_getprop(fdt, nodeoffset, name, sizeof(x), &x); \ }) +#define check_getprop_64(fdt, nodeoffset, name, val) \ + ({ \ + uint64_t x = cpu_to_fdt64(val); \ + check_getprop(fdt, nodeoffset, name, sizeof(x), &x); \ + }) #define check_getprop_string(fdt, nodeoffset, name, s) \ check_getprop((fdt), (nodeoffset), (name), strlen(s)+1, (s)) int nodename_eq(const char *s1, const char *s2); @@ -135,4 +124,6 @@ void *load_blob_arg(int argc, char *argv[]); void save_blob(const char *filename, void *blob); void *open_blob_rw(void *blob); +#include "util.h" + #endif /* _TESTS_H */ |