Tests: Create helper macros for the WriteVerify* commands
By creating a helper macros for WriteVerify we can save a lot of boilerplate code. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
void
|
||||
test_writeverify12_wrprotect(void)
|
||||
{
|
||||
int i, ret;
|
||||
int i;
|
||||
unsigned char *buf = alloca(block_size);
|
||||
|
||||
/*
|
||||
@@ -46,16 +46,9 @@ test_writeverify12_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 = writeverify12(sd, 0,
|
||||
block_size, block_size,
|
||||
i, 0, 0, 0, buf,
|
||||
EXPECT_INVALID_FIELD_IN_CDB);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] WRITEVERIFY12 is not implemented.");
|
||||
CU_PASS("WRITEVERIFY12 is not implemented.");
|
||||
return;
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
WRITEVERIFY12(sd, 0, block_size, block_size,
|
||||
i, 0, 0, 0, buf,
|
||||
EXPECT_INVALID_FIELD_IN_CDB);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user