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,7 +29,7 @@
void
test_read12_rdprotect(void)
{
int i, ret;
int i;
/*
* Try out different non-zero values for RDPROTECT.
@@ -42,16 +42,9 @@ test_read12_rdprotect(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 = read12(sd, NULL, 0,
block_size, block_size,
i, 0, 0, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] READ12 is not implemented.");
CU_PASS("READ12 is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
READ12(sd, NULL, 0, block_size, block_size,
i, 0, 0, 0, 0, NULL,
EXPECT_INVALID_FIELD_IN_CDB);
}
return;
}