diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-08 23:38:07 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-08 23:38:07 +0200 |
commit | 89d2ef97322ff5276e9a437e616a1e07529e0b26 (patch) | |
tree | c556b686eb323ca61036d69774553056ac8e2361 /src/microhttpd/test_sha256.c | |
parent | de872dea2d88f183c3f434c694acdcdb373f639c (diff) | |
parent | da0585902ce08aacf97f7711b85343d4d45c80fe (diff) | |
download | libmicrohttpd-89d2ef97322ff5276e9a437e616a1e07529e0b26.tar.gz libmicrohttpd-89d2ef97322ff5276e9a437e616a1e07529e0b26.zip |
define and use 'enum MHD_Result' (merge)
Diffstat (limited to 'src/microhttpd/test_sha256.c')
-rw-r--r-- | src/microhttpd/test_sha256.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/microhttpd/test_sha256.c b/src/microhttpd/test_sha256.c index 54cdf027..7ad5f399 100644 --- a/src/microhttpd/test_sha256.c +++ b/src/microhttpd/test_sha256.c | |||
@@ -289,16 +289,16 @@ bin2hex (const uint8_t *bin, | |||
289 | static int | 289 | static int |
290 | check_result (const char *test_name, | 290 | check_result (const char *test_name, |
291 | unsigned int check_num, | 291 | unsigned int check_num, |
292 | const uint8_t calcualted[SHA256_DIGEST_SIZE], | 292 | const uint8_t calculated[SHA256_DIGEST_SIZE], |
293 | const uint8_t expected[SHA256_DIGEST_SIZE]) | 293 | const uint8_t expected[SHA256_DIGEST_SIZE]) |
294 | { | 294 | { |
295 | int failed = memcmp (calcualted, expected, SHA256_DIGEST_SIZE); | 295 | int failed = memcmp (calculated, expected, SHA256_DIGEST_SIZE); |
296 | check_num++; /* Print 1-based numbers */ | 296 | check_num++; /* Print 1-based numbers */ |
297 | if (failed) | 297 | if (failed) |
298 | { | 298 | { |
299 | char calc_str[SHA256_DIGEST_STRING_SIZE]; | 299 | char calc_str[SHA256_DIGEST_STRING_SIZE]; |
300 | char expc_str[SHA256_DIGEST_STRING_SIZE]; | 300 | char expc_str[SHA256_DIGEST_STRING_SIZE]; |
301 | bin2hex (calcualted, SHA256_DIGEST_SIZE, calc_str); | 301 | bin2hex (calculated, SHA256_DIGEST_SIZE, calc_str); |
302 | bin2hex (expected, SHA256_DIGEST_SIZE, expc_str); | 302 | bin2hex (expected, SHA256_DIGEST_SIZE, expc_str); |
303 | fprintf (stderr, | 303 | fprintf (stderr, |
304 | "FAILED: %s check %u: calculated digest %s, expected digest %s.\n", | 304 | "FAILED: %s check %u: calculated digest %s, expected digest %s.\n", |
@@ -308,7 +308,7 @@ check_result (const char *test_name, | |||
308 | else if (verbose) | 308 | else if (verbose) |
309 | { | 309 | { |
310 | char calc_str[SHA256_DIGEST_STRING_SIZE]; | 310 | char calc_str[SHA256_DIGEST_STRING_SIZE]; |
311 | bin2hex (calcualted, SHA256_DIGEST_SIZE, calc_str); | 311 | bin2hex (calculated, SHA256_DIGEST_SIZE, calc_str); |
312 | printf ( | 312 | printf ( |
313 | "PASSED: %s check %u: calculated digest %s match expected digest.\n", | 313 | "PASSED: %s check %u: calculated digest %s match expected digest.\n", |
314 | test_name, check_num, calc_str); | 314 | test_name, check_num, calc_str); |