aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-24 11:38:07 +0200
committerMattias Andrée <maandree@kth.se>2024-08-24 11:38:07 +0200
commitdadf0cb089c36b0d49483b50cac97d017cd9389e (patch)
tree70053cf96f04efea0da5fb5c3289352e7c74a1ce /common.h
parentMake algorithms optional (diff)
downloadlibhashsum-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.h8
1 files changed, 8 insertions, 0 deletions
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;