summaryrefslogtreecommitdiff
path: root/crc
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-09-27 14:13:58 -0600
committerJens Axboe <axboe@fb.com>2014-09-27 14:13:58 -0600
commit9c8566f54872a2cff2b453438f9590e4c6582654 (patch)
tree8a1d3e5b87cb73a8d599c0eb64a277cf0fb5e8bd /crc
parent9ca144fec3077984e37397d0c1d1f6d098841e2e (diff)
downloadfio-9c8566f54872a2cff2b453438f9590e4c6582654.tar.gz
fio-9c8566f54872a2cff2b453438f9590e4c6582654.tar.bz2
crc/test: if the checksum needs a _final(), do it in the loop
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'crc')
-rw-r--r--crc/test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/crc/test.c b/crc/test.c
index 39ffac0b..6453a72b 100644
--- a/crc/test.c
+++ b/crc/test.c
@@ -55,10 +55,10 @@ static void t_md5(struct test_type *t, void *buf, size_t size)
fio_md5_init(&ctx);
- for (i = 0; i < NR_CHUNKS; i++)
+ for (i = 0; i < NR_CHUNKS; i++) {
fio_md5_update(&ctx, buf, size);
-
- fio_md5_final(&ctx);
+ fio_md5_final(&ctx);
+ }
}
static void t_crc64(struct test_type *t, void *buf, size_t size)
@@ -121,10 +121,10 @@ static void t_sha256(struct test_type *t, void *buf, size_t size)
fio_sha256_init(&ctx);
- for (i = 0; i < NR_CHUNKS; i++)
+ for (i = 0; i < NR_CHUNKS; i++) {
fio_sha256_update(&ctx, buf, size);
-
- fio_sha256_final(&ctx);
+ fio_sha256_final(&ctx);
+ }
}
static void t_sha512(struct test_type *t, void *buf, size_t size)