Tests: Add helpers for ORWRITE

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-21 10:11:45 -08:00
parent 69f4dc76ca
commit 0a814db48f
7 changed files with 70 additions and 132 deletions

View File

@@ -30,7 +30,7 @@
void
test_orwrite_simple(void)
{
int i, ret;
int i;
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
@@ -42,15 +42,9 @@ test_orwrite_simple(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = orwrite(sd, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, scratch,
EXPECT_STATUS_GOOD);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] ORWRITE is not implemented.");
CU_PASS("ORWRITE is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
ORWRITE(sd, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, scratch,
EXPECT_STATUS_GOOD);
}
logging(LOG_VERBOSE, "Test ORWRITE of 1-256 blocks at the end of the LUN");
@@ -58,11 +52,8 @@ test_orwrite_simple(void)
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
ret = orwrite(sd, num_blocks - i,
i * block_size, block_size,
0, 0, 0, 0, 0, scratch,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
ORWRITE(sd, num_blocks - i, i * block_size, block_size,
0, 0, 0, 0, 0, scratch,
EXPECT_STATUS_GOOD);
}
}