test-tool: Move all_zeroes() helper function to iscsi-support.c

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
Bart Van Assche
2015-10-02 14:32:56 -07:00
committed by Ronnie Sahlberg
parent 5231923bc8
commit 2d412530c1
8 changed files with 29 additions and 58 deletions

View File

@@ -30,9 +30,8 @@ void
test_writesame16_unmap_until_end(void)
{
int ret;
unsigned int i, j;
unsigned int i;
unsigned char *buf = alloca(256 * block_size);
unsigned char *zeroBlock;
CHECK_FOR_DATALOSS;
CHECK_FOR_THIN_PROVISIONING;
@@ -45,9 +44,6 @@ test_writesame16_unmap_until_end(void)
return;
}
zeroBlock = alloca(block_size);
memset(zeroBlock, 0, block_size);
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the end of the LUN by setting number-of-blocks==0");
memset(buf, 0xa6, 256 * block_size);
@@ -79,9 +75,7 @@ test_writesame16_unmap_until_end(void)
i * block_size, block_size,
0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
for (j = 0; j < i; j++) {
CU_ASSERT_EQUAL(memcmp(buf + j*block_size, zeroBlock, block_size), 0);
}
CU_ASSERT(all_zeroes(buf, i * block_size));
} else {
logging(LOG_VERBOSE, "LBPRZ is clear. Skip the read "
"and verify zero test");