Tests: Create a global scratch buffer and avoid allocating memory in the tests

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-21 07:56:47 -08:00
parent b4e4649ae5
commit f88bcf61cc
89 changed files with 454 additions and 545 deletions

View File

@@ -31,17 +31,16 @@ void
test_verify16_flags(void)
{
int ret;
unsigned char *buf = alloca(block_size);
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test VERIFY16 flags");
ret = read16(sd, NULL, 0, block_size,
block_size, 0, 0, 0, 0, 0, buf,
block_size, 0, 0, 0, 0, 0, scratch,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test VERIFY16 with BYTCHK==1");
VERIFY16(sd, 0, block_size, block_size, 0, 0, 1, buf,
VERIFY16(sd, 0, block_size, block_size, 0, 0, 1, scratch,
EXPECT_STATUS_GOOD);
}