From e7a90f7ecb53c3de36c55afe5528c8d1423dd9a8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 27 Apr 2015 11:57:01 +0200 Subject: [PATCH] test_sanitize_overwrite: Fix three log messages check_lun_is_wiped() verifies whether the 256 blocks following LBA 'lba' contain byte value 'c'. Modify the log messages such that these refer to byte value 'c' instead of to zero. Change the argument type of 'c' from char into unsigned char to avoid that 'c' is sign extended in the log statements. Signed-off-by: Bart Van Assche --- test-tool/test_sanitize_overwrite.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test-tool/test_sanitize_overwrite.c b/test-tool/test_sanitize_overwrite.c index b3c53f3..24b5221 100644 --- a/test-tool/test_sanitize_overwrite.c +++ b/test-tool/test_sanitize_overwrite.c @@ -40,7 +40,7 @@ init_lun_with_data(uint64_t lba) } static void -check_lun_is_wiped(uint64_t lba, char c) +check_lun_is_wiped(uint64_t lba, unsigned char c) { int ret; unsigned char *rbuf = alloca(256 * block_size); @@ -54,13 +54,11 @@ check_lun_is_wiped(uint64_t lba, char c) memset(zbuf, c, 256 * block_size); if (memcmp(zbuf, rbuf, 256 * block_size)) { - logging(LOG_NORMAL, "[FAILED] Blocks did not " - "read back as zero"); - CU_FAIL("[FAILED] Blocks did not read back " - "as zero"); + logging(LOG_NORMAL, "[FAILED] Blocks did not read back as %#x", + c); + CU_FAIL("[FAILED] Blocks did not read back as expected"); } else { - logging(LOG_VERBOSE, "[SUCCESS] Blocks read " - "back as zero"); + logging(LOG_VERBOSE, "[SUCCESS] Blocks read back as %#x", c); } }