aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmark-crypto-hash.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2020-09-09 13:01:45 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2020-09-10 11:02:17 +0100
commitca04c3cf15961e4a01c729a24b00bf804f59ac23 (patch)
tree0c100a8ecdaca54a2f6e81ca544b96acb919638c /tests/benchmark-crypto-hash.c
parent9435a8b3dd35f1f926f1b9127e8a906217a5518a (diff)
downloadqemu-ca04c3cf15961e4a01c729a24b00bf804f59ac23.zip
qemu-ca04c3cf15961e4a01c729a24b00bf804f59ac23.tar.gz
qemu-ca04c3cf15961e4a01c729a24b00bf804f59ac23.tar.bz2
tests: fix output message formatting for crypto benchmarks
The output was changed from g_print to g_test_message in commit 24441f912e67233d9c52ce6b459ed75de2484525 Author: Marc-André Lureau <marcandre.lureau@redhat.com> Date: Fri Aug 28 15:07:30 2020 +0400 tests: do not print benchmark output to stdout As this makes the TAP output invalid. Use g_test_message(). The functions do not result in equivalent output. The g_print statements were putting all the information on a single line for ease of interpretation. The change to g_test_message split the output across many lines making it painful to read. The opportunity is used to tweak the information printed to be more consistent across tests. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'tests/benchmark-crypto-hash.c')
-rw-r--r--tests/benchmark-crypto-hash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/benchmark-crypto-hash.c b/tests/benchmark-crypto-hash.c
index 598111e..927b00b 100644
--- a/tests/benchmark-crypto-hash.c
+++ b/tests/benchmark-crypto-hash.c
@@ -48,7 +48,9 @@ static void test_hash_speed(const void *opaque)
}
g_test_timer_elapsed();
- g_test_message("%.2f MB/sec ", (double)total / MiB / g_test_timer_last());
+ g_test_message("hash(%s): chunk %zu bytes %.2f MB/sec",
+ QCryptoHashAlgorithm_str(opts->alg),
+ opts->chunk_size, total / g_test_timer_last());
g_free(out);
g_free(in);