From 581ad1d65babac70cb8f8971ac237724593ae107 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Fri, 19 May 2023 14:27:55 +0300 Subject: [PATCH] tests: fixed code style --- src/microhttpd/test_md5.c | 6 +++--- src/microhttpd/test_sha1.c | 6 +++--- src/microhttpd/test_sha256.c | 8 +++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/microhttpd/test_md5.c b/src/microhttpd/test_md5.c index b82dbc0b..463eed32 100644 --- a/src/microhttpd/test_md5.c +++ b/src/microhttpd/test_md5.c @@ -290,7 +290,7 @@ test1_str (void) uint8_t digest[MD5_DIGEST_SIZE]; MHD_MD5Init (&ctx); - MHD_MD5Update (&ctx, (const uint8_t*) data_units1[i].str_l.str, + MHD_MD5Update (&ctx, (const uint8_t *) data_units1[i].str_l.str, data_units1[i].str_l.len); MHD_MD5Final (&ctx, digest); num_failed += check_result (MHD_FUNC_, i, digest, @@ -335,8 +335,8 @@ test2_str (void) size_t part_s = data_units1[i].str_l.len / 4; MHD_MD5Init (&ctx); - MHD_MD5Update (&ctx, (const uint8_t*) data_units1[i].str_l.str, part_s); - MHD_MD5Update (&ctx, (const uint8_t*) data_units1[i].str_l.str + part_s, + MHD_MD5Update (&ctx, (const uint8_t *) data_units1[i].str_l.str, part_s); + MHD_MD5Update (&ctx, (const uint8_t *) data_units1[i].str_l.str + part_s, data_units1[i].str_l.len - part_s); MHD_MD5Final (&ctx, digest); num_failed += check_result (MHD_FUNC_, i, digest, diff --git a/src/microhttpd/test_sha1.c b/src/microhttpd/test_sha1.c index 75fe9a79..6ffd5894 100644 --- a/src/microhttpd/test_sha1.c +++ b/src/microhttpd/test_sha1.c @@ -275,7 +275,7 @@ test1_str (void) uint8_t digest[SHA1_DIGEST_SIZE]; MHD_SHA1_init (&ctx); - MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, + MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str, data_units1[i].str_l.len); MHD_SHA1_finish (&ctx, digest); num_failed += check_result (MHD_FUNC_, i, digest, @@ -321,8 +321,8 @@ test2_str (void) size_t part_s = data_units1[i].str_l.len / 4; MHD_SHA1_init (&ctx); - MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, part_s); - MHD_SHA1_update (&ctx, (const uint8_t*) data_units1[i].str_l.str + part_s, + MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str, part_s); + MHD_SHA1_update (&ctx, (const uint8_t *) data_units1[i].str_l.str + part_s, data_units1[i].str_l.len - part_s); MHD_SHA1_finish (&ctx, digest); num_failed += check_result (MHD_FUNC_, i, digest, diff --git a/src/microhttpd/test_sha256.c b/src/microhttpd/test_sha256.c index f355fc4f..b845303f 100644 --- a/src/microhttpd/test_sha256.c +++ b/src/microhttpd/test_sha256.c @@ -336,7 +336,7 @@ test1_str (void) uint8_t digest[SHA256_DIGEST_SIZE]; MHD_SHA256_init (&ctx); - MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, + MHD_SHA256_update (&ctx, (const uint8_t *) data_units1[i].str_l.str, data_units1[i].str_l.len); MHD_SHA256_finish (&ctx, digest); num_failed += check_result (MHD_FUNC_, i, digest, @@ -382,8 +382,10 @@ test2_str (void) size_t part_s = data_units1[i].str_l.len / 4; MHD_SHA256_init (&ctx); - MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str, part_s); - MHD_SHA256_update (&ctx, (const uint8_t*) data_units1[i].str_l.str + part_s, + MHD_SHA256_update (&ctx, (const uint8_t *) data_units1[i].str_l.str, + part_s); + MHD_SHA256_update (&ctx, (const uint8_t *) data_units1[i].str_l.str + + part_s, data_units1[i].str_l.len - part_s); MHD_SHA256_finish (&ctx, digest); num_failed += check_result (MHD_FUNC_, i, digest,