test-tool, compare and write: Reduce maximum number of blocks from 256 to 255

Since the NUMBER OF LOGICAL BLOCKS field in the COMPARE AND WRITE command
is an 8 bit field, the maximum value that can be encoded is 255.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2020-05-15 09:53:22 -07:00
parent b4d59cd29c
commit 33c66f2c39
3 changed files with 6 additions and 6 deletions

View File

@@ -41,10 +41,10 @@ test_compareandwrite_miscompare(void)
maxbl = inq_bl->max_cmp;
} else {
/* Assume we are not limited */
maxbl = 256;
maxbl = 255;
}
n = 256;
n = 255;
if (n + 0U > num_blocks)
n = num_blocks;

View File

@@ -41,10 +41,10 @@ test_compareandwrite_simple(void)
maxbl = inq_bl->max_cmp;
} else {
/* Assume we are not limited */
maxbl = 256;
maxbl = 255;
}
n = 256;
n = 255;
if (n + 0U > num_blocks)
n = num_blocks;
if (maxbl + 0U > num_blocks)

View File

@@ -44,14 +44,14 @@ test_multipathio_compareandwrite(void)
maxbl = inq_bl->max_cmp;
} else {
/* Assume we are not limited */
maxbl = 256;
maxbl = 255;
}
if (maxbl < io_bl) {
CU_PASS("[SKIPPED] MAXIMUM_COMPARE_AND_WRITE_LENGTH too small");
return;
}
n = 256;
n = 255;
if (n + 0U > num_blocks)
n = num_blocks;