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:
@@ -30,18 +30,17 @@ void
|
||||
test_verify10_flags(void)
|
||||
{
|
||||
int ret;
|
||||
unsigned char *buf = alloca(block_size);
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test VERIFY10 flags");
|
||||
|
||||
ret = read10(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 VERIFY10 with BYTCHK==1");
|
||||
VERIFY10(sd, 0, block_size, block_size, 0, 0, 1, buf,
|
||||
VERIFY10(sd, 0, block_size, block_size, 0, 0, 1, scratch,
|
||||
EXPECT_STATUS_GOOD);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user