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 <bart.vanassche@sandisk.com>
This commit is contained in:
Bart Van Assche
2015-04-27 11:57:01 +02:00
committed by Ronnie Sahlberg
parent 52a57d26f2
commit e7a90f7ecb

View File

@@ -40,7 +40,7 @@ init_lun_with_data(uint64_t lba)
} }
static void static void
check_lun_is_wiped(uint64_t lba, char c) check_lun_is_wiped(uint64_t lba, unsigned char c)
{ {
int ret; int ret;
unsigned char *rbuf = alloca(256 * block_size); 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); memset(zbuf, c, 256 * block_size);
if (memcmp(zbuf, rbuf, 256 * block_size)) { if (memcmp(zbuf, rbuf, 256 * block_size)) {
logging(LOG_NORMAL, "[FAILED] Blocks did not " logging(LOG_NORMAL, "[FAILED] Blocks did not read back as %#x",
"read back as zero"); c);
CU_FAIL("[FAILED] Blocks did not read back " CU_FAIL("[FAILED] Blocks did not read back as expected");
"as zero");
} else { } else {
logging(LOG_VERBOSE, "[SUCCESS] Blocks read " logging(LOG_VERBOSE, "[SUCCESS] Blocks read back as %#x", c);
"back as zero");
} }
} }