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

@@ -29,8 +29,7 @@
void
test_read10_simple(void)
{
int i, ret;
int i;
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test READ10 of 1-256 blocks at the start of the LUN");
@@ -38,10 +37,9 @@ test_read10_simple(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read10(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
READ10(sd, NULL, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
}
logging(LOG_VERBOSE, "Test READ10 of 1-256 blocks at the end of the LUN");
@@ -49,9 +47,8 @@ test_read10_simple(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = read10(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
READ10(sd, NULL, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL,
EXPECT_STATUS_GOOD);
}
}