Tests: Add helper macros for Write*

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-20 19:33:02 -08:00
parent bd29dab95b
commit eba1ac059a
29 changed files with 252 additions and 493 deletions

View File

@@ -30,7 +30,7 @@
void
test_write12_wrprotect(void)
{
int i, ret;
int i;
unsigned char *buf = alloca(block_size);
@@ -47,16 +47,9 @@ test_write12_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 = write12(sd, 0,
block_size, block_size,
i, 0, 0, 0, 0, buf,
EXPECT_INVALID_FIELD_IN_CDB);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] WRITE12 is not implemented.");
CU_PASS("WRITE12 is not implemented.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
WRITE12(sd, 0, block_size, block_size,
i, 0, 0, 0, 0, buf,
EXPECT_INVALID_FIELD_IN_CDB);
}
return;
}