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

@@ -43,8 +43,6 @@ test_unmap_simple(void)
int i, ret;
struct unmap_list list[257];
unsigned char *buf = alloca(256 * block_size);
unsigned char *zbuf = alloca(256 * block_size);
memset(zbuf, 0, 256 * block_size);
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test basic UNMAP");
@@ -77,7 +75,7 @@ test_unmap_simple(void)
if (rc16 && rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ==1 All UNMAPPED blocks "
"should read back as 0");
if (memcmp(buf, zbuf, i * block_size)) {
if (all_zeroes(buf, i * block_size) == 0) {
logging(LOG_NORMAL, "[FAILED] Blocks did not "
"read back as zero");
CU_FAIL("[FAILED] Blocks did not read back "
@@ -112,7 +110,7 @@ test_unmap_simple(void)
if (rc16 && rc16->lbprz) {
logging(LOG_VERBOSE, "LBPRZ==1 All UNMAPPED blocks "
"should read back as 0");
if (memcmp(buf, zbuf, i * block_size)) {
if (all_zeroes(buf, i * block_size) == 0) {
logging(LOG_NORMAL, "[FAILED] Blocks did not "
"read back as zero");
CU_FAIL("[FAILED] Blocks did not read back "