TESTS: Fix num_blocks offset by one in the beyond-eol tests

This commit is contained in:
Ronnie Sahlberg
2013-01-21 20:27:12 -08:00
parent bfbde8b097
commit 7027ccb3b2
10 changed files with 20 additions and 20 deletions

View File

@@ -37,7 +37,7 @@ test_read10_beyond_eol(void)
logging(LOG_VERBOSE, "");
logging(LOG_VERBOSE, "Test READ10 1-256 blocks one block beyond the end");
for (i = 1; i <= 256; i++) {
ret = read10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = read10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
@@ -63,7 +63,7 @@ test_read10_beyond_eol(void)
logging(LOG_VERBOSE, "Test READ10 2-256 blocks all but one block beyond the end");
for (i = 2; i <= 256; i++) {
ret = read10_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = read10_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -37,7 +37,7 @@ test_read12_beyond_eol(void)
logging(LOG_VERBOSE, "");
logging(LOG_VERBOSE, "Test READ12 1-256 blocks one block beyond the end");
for (i = 1; i <= 256; i++) {
ret = read12_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = read12_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
@@ -63,7 +63,7 @@ test_read12_beyond_eol(void)
logging(LOG_VERBOSE, "Test READ12 2-256 blocks all but one block beyond the end");
for (i = 2; i <= 256; i++) {
ret = read12_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = read12_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -34,7 +34,7 @@ test_read16_beyond_eol(void)
logging(LOG_VERBOSE, "");
logging(LOG_VERBOSE, "Test READ16 1-256 blocks one block beyond the end");
for (i = 1; i <= 256; i++) {
ret = read16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = read16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
@@ -60,7 +60,7 @@ test_read16_beyond_eol(void)
logging(LOG_VERBOSE, "Test READ16 2-256 blocks all but one block beyond the end");
for (i = 2; i <= 256; i++) {
ret = read16_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = read16_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -38,7 +38,7 @@ test_read6_beyond_eol(void)
logging(LOG_VERBOSE, "");
logging(LOG_VERBOSE, "Test READ6 1-255 blocks one block beyond the end");
for (i = 1; i <= 255; i++) {
ret = read6_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = read6_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
NULL);
CU_ASSERT_EQUAL(ret, 0);
@@ -56,7 +56,7 @@ test_read6_beyond_eol(void)
logging(LOG_VERBOSE, "Test READ6 2-255 blocks all but one block beyond the end");
for (i = 2; i <= 255; i++) {
ret = read6_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = read6_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
NULL);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -39,7 +39,7 @@ test_verify10_beyond_eol(void)
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = verify10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = verify10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 1, buf);
free(buf);
@@ -74,7 +74,7 @@ test_verify10_beyond_eol(void)
for (i = 2; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = verify10_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = verify10_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 1, buf);
free(buf);

View File

@@ -39,7 +39,7 @@ test_verify12_beyond_eol(void)
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = verify12_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = verify12_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 1, buf);
free(buf);
@@ -74,7 +74,7 @@ test_verify12_beyond_eol(void)
for (i = 2; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = verify12_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = verify12_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 1, buf);
free(buf);

View File

@@ -34,7 +34,7 @@ test_verify16_beyond_eol(void)
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = verify16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = verify16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 1, buf);
free(buf);
@@ -69,7 +69,7 @@ test_verify16_beyond_eol(void)
for (i = 2; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = verify16_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = verify16_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 1, buf);
free(buf);

View File

@@ -41,7 +41,7 @@ test_write10_beyond_eol(void)
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = write10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = write10_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
free(buf);
@@ -76,7 +76,7 @@ test_write10_beyond_eol(void)
for (i = 2; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = write10_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = write10_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
free(buf);

View File

@@ -41,7 +41,7 @@ test_write12_beyond_eol(void)
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = write12_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = write12_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
free(buf);
@@ -76,7 +76,7 @@ test_write12_beyond_eol(void)
for (i = 2; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = write12_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = write12_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
free(buf);

View File

@@ -37,7 +37,7 @@ test_write16_beyond_eol(void)
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = write16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 2 - i,
ret = write16_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1 - i,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
free(buf);
@@ -72,7 +72,7 @@ test_write16_beyond_eol(void)
for (i = 2; i <= 256; i++) {
unsigned char *buf = malloc(block_size * i);
ret = write16_lbaoutofrange(iscsic, tgt_lun, num_blocks,
ret = write16_lbaoutofrange(iscsic, tgt_lun, num_blocks - 1,
i * block_size, block_size,
0, 0, 0, 0, 0, buf);
free(buf);