diff options
author | Mattias Andrée <maandree@kth.se> | 2024-08-24 11:38:07 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-08-24 11:38:07 +0200 |
commit | dadf0cb089c36b0d49483b50cac97d017cd9389e (patch) | |
tree | 70053cf96f04efea0da5fb5c3289352e7c74a1ce /common.h | |
parent | Make algorithms optional (diff) | |
download | libhashsum-dadf0cb089c36b0d49483b50cac97d017cd9389e.tar.gz libhashsum-dadf0cb089c36b0d49483b50cac97d017cd9389e.tar.bz2 libhashsum-dadf0cb089c36b0d49483b50cac97d017cd9389e.tar.xz |
Add libhashsum_hasher.algorithm_string
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |