From dadf0cb089c36b0d49483b50cac97d017cd9389e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 Aug 2024 11:38:07 +0200 Subject: Add libhashsum_hasher.algorithm_string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- common.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common.h') diff --git a/common.h b/common.h index f41ef53..5bfac1e 100644 --- a/common.h +++ b/common.h @@ -89,6 +89,14 @@ run_tests(const char *name, enum libhashsum_algorithm algorithm, size_t hash_siz fprintf(stderr, "libhashsum_init_hasher returned unexpected value in .algorithm\n"); return 2; } + if (!hasher.algorithm_string) { + fprintf(stderr, "libhashsum_init_hasher returned NULL pointer in .algorithm_string\n"); + return 2; + } + if (strcmp(hasher.algorithm_string, name)) { + fprintf(stderr, "libhashsum_init_hasher returned unexpected value in .algorithm_string\n"); + return 2; + } if (hasher.hash_size != hash_size) { fprintf(stderr, "libhashsum_init_hasher returned unexpected value in .hash_size\n"); return 2; -- cgit v1.2.3-70-g09d2