TEST: Add test for 0 blocks for UNMAP and fix num_blocks which was off by one

across the testsuite
This commit is contained in:
Ronnie Sahlberg
2013-01-21 20:20:46 -08:00
parent 72598c0b46
commit bfbde8b097
21 changed files with 94 additions and 30 deletions

View File

@@ -60,7 +60,7 @@ test_verify10_mismatch(void)
unsigned char *buf = malloc(block_size * i);
int offset = random() % (i * block_size);
ret = read10(iscsic, tgt_lun, num_blocks +1 - i,
ret = read10(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, buf);
CU_ASSERT_EQUAL(ret, 0);
@@ -68,7 +68,7 @@ test_verify10_mismatch(void)
buf[offset] ^= 'X';
logging(LOG_VERBOSE, "Flip some bits in the data");
ret = verify10_miscompare(iscsic, tgt_lun, num_blocks +1 - i,
ret = verify10_miscompare(iscsic, tgt_lun, num_blocks - i,
i * block_size, block_size, 0, 0, 1, buf);
free(buf);
CU_ASSERT_EQUAL(ret, 0);