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:
committed by
Ronnie Sahlberg
parent
52a57d26f2
commit
e7a90f7ecb
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user