Date: Tue, 8 Mar 2022 00:33:30 GMT From: Ed Maste <emaste@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 71f452d58c7a - stable/13 - zfs: Update test format strings to match variable typtes Message-ID: <202203080033.2280XUeE088911@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=71f452d58c7aa4625816015eec153718021b5db4 commit 71f452d58c7aa4625816015eec153718021b5db4 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2022-02-28 01:11:20 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2022-03-08 00:33:21 +0000 zfs: Update test format strings to match variable typtes And drop stray 'd' from the end of some printed numbers. I assume this was the result of someone thinking u is a printf length modifier for d, not a format specifier itself. Reviewed by: kevans, rew MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34387 (cherry picked from commit f27fb06cadc6a8e75ebebd3b60c8a9dc9ae1b833) --- tests/sys/cddl/zfs/bin/readmmap.c | 8 ++++---- tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c | 4 ++-- tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c | 4 ++-- tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/sys/cddl/zfs/bin/readmmap.c b/tests/sys/cddl/zfs/bin/readmmap.c index 117246a8c2c4..d2dd5605351d 100644 --- a/tests/sys/cddl/zfs/bin/readmmap.c +++ b/tests/sys/cddl/zfs/bin/readmmap.c @@ -83,7 +83,7 @@ main(int argc, char **argv) bytes = write(fd, buf, size); if (bytes != size) { - (void) printf("short write: %d != %ud\n", bytes, size); + (void) printf("short write: %d != %zu\n", bytes, size); retval = 1; goto end; } @@ -114,20 +114,20 @@ main(int argc, char **argv) bytes = pread(fd, buf, size, 0); if (bytes != size) { - (void) printf("short read: %d != %ud\n", bytes, size); + (void) printf("short read: %d != %zu\n", bytes, size); retval = 1; goto end; } if (buf[idx] != 1) { (void) printf( - "bad data from read! got buf[%ud]=%d, expected 1\n", + "bad data from read! got buf[%zu]=%d, expected 1\n", idx, buf[idx]); retval = 1; goto end; } - (void) printf("good data from read: buf[%ud]=1\n", idx); + (void) printf("good data from read: buf[%zu]=1\n", idx); end: if (fd != -1) { (void) close(fd); diff --git a/tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c b/tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c index afccda1a8840..d858cebd26a8 100644 --- a/tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c +++ b/tests/sys/cddl/zfs/tests/ctime/ctime_001_pos.c @@ -227,7 +227,7 @@ do_read(const char *pfile) (void) close(fd); if (ret != 0) { - fprintf(stderr, "read(%d, buf, %d)\n", fd, sizeof (buf)); + fprintf(stderr, "read(%d, buf, %zu)\n", fd, sizeof (buf)); exit(1); } @@ -253,7 +253,7 @@ do_write(const char *pfile) (void) close(fd); if (ret != 0) { - fprintf(stderr, "write(%d, buf, %d)\n", fd, strlen(buf)); + fprintf(stderr, "write(%d, buf, %zu)\n", fd, strlen(buf)); exit(1); } diff --git a/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c b/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c index 0daba26579d4..b2d4bf0dc11a 100644 --- a/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c +++ b/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c @@ -332,7 +332,7 @@ verify_file(int fd, const pattern_t* p_pat){ int file_offset = chunk_start + chunk_offset; if (good_data && (actual_buf[i] != desired_buf[i])){ fprintf(stderr, "fsync_integrity: miscompare at " - "chunk %i, chunk offset %lx, file offset %lx\n", + "chunk %i, chunk offset %x, file offset %x\n", chunk_idx, chunk_offset, file_offset); fprintf(stderr, "Expected %016lx, got %016lx\n", desired_buf[i], actual_buf[i]); @@ -341,7 +341,7 @@ verify_file(int fd, const pattern_t* p_pat){ } else if (!good_data && (actual_buf[i] == desired_buf[i])) { fprintf(stderr, "fsync_integrity: miscompare ends at " - "chunk %i, chunk offset %lx, file offset %lx\n", + "chunk %i, chunk offset %x, file offset %x\n", chunk_idx, chunk_offset, file_offset); good_data = 1; } diff --git a/tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c b/tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c index 3200fca3bc90..ec1275dfccc0 100644 --- a/tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c +++ b/tests/sys/cddl/zfs/tests/txg_integrity/txg_integrity.c @@ -370,7 +370,7 @@ verify_file(int fd, const pattern_t* p_pat){ int file_offset = chunk_start + chunk_offset; if (good_data && (actual_buf[i] != desired_buf[i])){ fprintf(stderr, "txg_integrity: miscompare at " - "chunk %i, chunk offset %lx, file offset %lx\n", + "chunk %i, chunk offset %x, file offset %x\n", chunk_idx, chunk_offset, file_offset); fprintf(stderr, "Expected %16lx, got %16lx\n", desired_buf[i], actual_buf[i]); @@ -379,7 +379,7 @@ verify_file(int fd, const pattern_t* p_pat){ } else if (!good_data && (actual_buf[i] == desired_buf[i])) { fprintf(stderr, "txg_integrity: miscompare ends at " - "chunk %i, chunk offset %lx, file offset %lx\n", + "chunk %i, chunk offset %x, file offset %x\n", chunk_idx, chunk_offset, file_offset); good_data = 1; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203080033.2280XUeE088911>