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_wrprotect(void)
{
int i, ret;
int i;
/*
* Try out different non-zero values for WRPROTECT.
@@ -45,16 +45,9 @@ test_orwrite_wrprotect(void)
if (!inq->protect || (rc16 != NULL && !rc16->prot_en)) {
logging(LOG_VERBOSE, "Device does not support/use protection information. All commands should fail.");
for (i = 1; i < 8; i++) {
ret = orwrite(sd, 0, block_size,
block_size, i, 0, 0, 0, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
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, block_size,
block_size, i, 0, 0, 0, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
}
return;
}