aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common.h')
-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;