Tests: add helpers for read*

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-21 11:07:54 -08:00
parent 0a814db48f
commit c48283fe75
59 changed files with 377 additions and 603 deletions

View File

@@ -34,7 +34,7 @@ test_write16_residuals(void)
struct scsi_task *task_ret;
unsigned char buf[10000];
struct iscsi_data data;
int ret, ok;
int ok;
unsigned int i;
logging(LOG_VERBOSE, LOG_BLANK_LINE);
@@ -296,10 +296,8 @@ test_write16_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read16(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
READ16(sd, NULL, 0, 2* block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
logging(LOG_VERBOSE, "Verify that the first block was changed to 'b'");
for (i = 0; i < block_size; i++) {
@@ -370,10 +368,8 @@ test_write16_residuals(void)
task = NULL;
logging(LOG_VERBOSE, "Read the two blocks");
ret = read16(sd, NULL, 0, 2* block_size,
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
READ16(sd, NULL, 0, 2* block_size, block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
logging(LOG_VERBOSE, "Verify that the first block was changed to 'b'");
for (i = 0; i < block_size; i++) {