From ca04c3cf15961e4a01c729a24b00bf804f59ac23 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrangé" Date: Wed, 9 Sep 2020 13:01:45 +0100 Subject: tests: fix output message formatting for crypto benchmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The output was changed from g_print to g_test_message in commit 24441f912e67233d9c52ce6b459ed75de2484525 Author: Marc-André Lureau 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é Signed-off-by: Daniel P. Berrangé --- tests/benchmark-crypto-cipher.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/benchmark-crypto-cipher.c') diff --git a/tests/benchmark-crypto-cipher.c b/tests/benchmark-crypto-cipher.c index 1936aa4ae0..c04f0a0fba 100644 --- a/tests/benchmark-crypto-cipher.c +++ b/tests/benchmark-crypto-cipher.c @@ -70,8 +70,10 @@ static void test_cipher_speed(size_t chunk_size, } g_test_timer_elapsed(); - g_test_message("Enc chunk %zu bytes ", chunk_size); - g_test_message("%.2f MB/sec ", (double)total / MiB / g_test_timer_last()); + g_test_message("enc(%s-%s) chunk %zu bytes %.2f MB/sec ", + QCryptoCipherAlgorithm_str(alg), + QCryptoCipherMode_str(mode), + chunk_size, (double)total / MiB / g_test_timer_last()); g_test_timer_start(); remain = total; @@ -85,8 +87,10 @@ static void test_cipher_speed(size_t chunk_size, } g_test_timer_elapsed(); - g_test_message("Dec chunk %zu bytes ", chunk_size); - g_test_message("%.2f MB/sec ", (double)total / MiB / g_test_timer_last()); + g_test_message("dec(%s-%s) chunk %zu bytes %.2f MB/sec ", + QCryptoCipherAlgorithm_str(alg), + QCryptoCipherMode_str(mode), + chunk_size, (double)total / MiB / g_test_timer_last()); qcrypto_cipher_free(cipher); g_free(plaintext); -- cgit 1.4.1