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

@@ -110,6 +110,7 @@ static CU_TestInfo tests_readcapacity16[] = {
static CU_TestInfo tests_unmap[] = {
{ (char *)"testUnmapSimple", test_unmap_simple },
{ (char *)"testUnmapZeroBlocks", test_unmap_0blocks },
CU_TEST_INFO_NULL
};
@@ -518,7 +519,7 @@ main(int argc, char *argv[])
return -1;
}
block_size = rc10->block_size;
num_blocks = rc10->lba;
num_blocks = rc10->lba + 1;
scsi_free_scsi_task(task);
task = iscsi_readcapacity16_sync(iscsic, lun);
@@ -538,7 +539,7 @@ main(int argc, char *argv[])
return -1;
}
block_size = rc16->block_length;
num_blocks = rc16->returned_lba;
num_blocks = rc16->returned_lba + 1;
lbpme = rc16->lbpme;
lbppb = 1 << rc16->lbppbe;
lbpme = rc16->lbpme;