diff options
author | Martin Storsjö <martin@martin.st> | 2019-06-20 23:38:06 +0300 |
---|---|---|
committer | Josh de Kock <josh@itanimul.li> | 2020-05-15 10:29:30 +0100 |
commit | 3ce1b2bf8d75708ea041f6bbad86b2b249643b9a (patch) | |
tree | e5d22d062f28f92f3406ce75497521ba6842c012 /tests/checkasm/checkasm.h | |
parent | 718c8f9aa59751bb490e2688acf2b5cb68fd5ad1 (diff) | |
download | ffmpeg-3ce1b2bf8d75708ea041f6bbad86b2b249643b9a.tar.gz |
checkasm: add function to check and diff memory
This was ported from dav1d (c950e7101bdf5f7117bfca816984a21e550509f0).
Signed-off-by: Josh de Kock <josh@itanimul.li>
Diffstat (limited to 'tests/checkasm/checkasm.h')
-rw-r--r-- | tests/checkasm/checkasm.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 0a7f9f25c4..5807d32e14 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -257,4 +257,20 @@ typedef struct CheckasmPerf { #define PERF_STOP(t) while(0) #endif +#define DECL_CHECKASM_CHECK_FUNC(type) \ +int checkasm_check_##type(const char *const file, const int line, \ + const type *const buf1, const ptrdiff_t stride1, \ + const type *const buf2, const ptrdiff_t stride2, \ + const int w, const int h, const char *const name) + +DECL_CHECKASM_CHECK_FUNC(uint8_t); +DECL_CHECKASM_CHECK_FUNC(uint16_t); +DECL_CHECKASM_CHECK_FUNC(int16_t); +DECL_CHECKASM_CHECK_FUNC(int32_t); + +#define PASTE(a,b) a ## b +#define CONCAT(a,b) PASTE(a,b) + +#define checkasm_check(prefix, ...) CONCAT(checkasm_check_, prefix)(__FILE__, __LINE__, __VA_ARGS__) + #endif /* TESTS_CHECKASM_CHECKASM_H */ |