diff options
Diffstat (limited to 'test/tests.h')
-rw-r--r-- | test/tests.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/tests.h b/test/tests.h index f4065f596f..8b2eb98174 100644 --- a/test/tests.h +++ b/test/tests.h @@ -43,6 +43,7 @@ extern const struct unittest test_json; extern const struct unittest test_linked_list; extern const struct unittest test_repack_sws; extern const struct unittest test_repack_zimg; +extern const struct unittest test_repack; extern const struct unittest test_paths; #define assert_true(x) assert(x) @@ -54,6 +55,10 @@ extern const struct unittest test_paths; #define assert_float_equal(a, b, tolerance) \ assert_float_equal_impl(__FILE__, __LINE__, (a), (b), (tolerance)) +// Assert that memcmp(a,b,s)==0, or hexdump output on failure. +#define assert_memcmp(a, b, s) \ + assert_memcmp_impl(__FILE__, __LINE__, (a), (b), (s)) + // Require that the files "ref" and "new" are the same. The paths can be // relative to ref_path and out_path respectively. If they're not the same, // the output of "diff" is shown, the err message (if not NULL), and the test @@ -69,6 +74,8 @@ void assert_float_equal_impl(const char *file, int line, void assert_text_files_equal_impl(const char *file, int line, struct test_ctx *ctx, const char *ref, const char *new, const char *err); +void assert_memcmp_impl(const char *file, int line, + const void *a, const void *b, size_t size); // Open a new file in the out_path. Always succeeds. FILE *test_open_out(struct test_ctx *ctx, const char *name); |