Tests: Add helper macros for Verify*

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-20 20:00:45 -08:00
parent eba1ac059a
commit b4e4649ae5
25 changed files with 174 additions and 381 deletions

View File

@@ -30,7 +30,7 @@ void
test_verify10_flags(void)
{
int ret;
unsigned char *buf = malloc(block_size);
unsigned char *buf = alloca(block_size);
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test VERIFY10 flags");
@@ -42,15 +42,6 @@ test_verify10_flags(void)
logging(LOG_VERBOSE, "Test VERIFY10 with BYTCHK==1");
ret = verify10(sd, 0, block_size,
block_size, 0, 0, 1, buf,
EXPECT_STATUS_GOOD);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] VERIFY10 is not implemented.");
CU_PASS("[SKIPPED] Target does not support VERIFY10. Skipping test");
free(buf);
return;
}
CU_ASSERT_EQUAL(ret, 0);
free(buf);
VERIFY10(sd, 0, block_size, block_size, 0, 0, 1, buf,
EXPECT_STATUS_GOOD);
}