Tests: Add helpers for WRITESAME

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-21 08:57:26 -08:00
parent 4d1e3aecd0
commit 0b5b724f17
15 changed files with 169 additions and 276 deletions

View File

@@ -30,7 +30,7 @@
void
test_writesame16_wrprotect(void)
{
int i, ret;
int i;
/*
* Try out different non-zero values for WRPROTECT.
@@ -45,15 +45,8 @@ test_writesame16_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 = writesame16(sd, 0,
block_size, 1, 0, 0, i, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] WRITESAME16 is not implemented.");
CU_PASS("[SKIPPED] Target does not support WRITESAME16. Skipping test");
return;
}
CU_ASSERT_EQUAL(ret, 0);
WRITESAME16(sd, 0, block_size, 1, 0, 0, i, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
}
return;
}