git: f1f030246f3e - main - posixshm_test: small style fixes
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 09 Dec 2022 12:17:44 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f1f030246f3e72af0ee3ba82a0e8b9f6d9559b69 commit f1f030246f3e72af0ee3ba82a0e8b9f6d9559b69 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-12-03 22:54:13 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-12-09 12:17:12 +0000 posixshm_test: small style fixes Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D37097 --- tests/sys/posixshm/posixshm_test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index 6398f5f6e085..add22c330b4e 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -1081,7 +1081,7 @@ ATF_TC_BODY(fallocate, tc) ATF_REQUIRE_MSG((error = posix_fallocate(fd, sz, sz)) == 0, "posix_fallocate failed; error=%d", error); ATF_REQUIRE(fstat(fd, &st) == 0); - ATF_REQUIRE(st.st_size == (sz * 2)); + ATF_REQUIRE(st.st_size == sz * 2); close(fd); } @@ -1097,7 +1097,7 @@ ATF_TC_BODY(fspacectl, tc) page_size = getpagesize(); shm_sz = shm_max_pages * page_size; - fd = shm_open("/testtest", O_RDWR|O_CREAT, 0666); + fd = shm_open("/testtest", O_RDWR | O_CREAT, 0666); ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; errno:%d", errno); ATF_REQUIRE_MSG((error = posix_fallocate(fd, 0, shm_sz)) == 0, "posix_fallocate failed; error=%d", error); @@ -1115,7 +1115,7 @@ ATF_TC_BODY(fspacectl, tc) /* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); range.r_offset = offset = page_size / 2; - range.r_len = length = ((shm_max_pages - 1) * page_size) + + range.r_len = length = (shm_max_pages - 1) * page_size + (page_size / 2) - offset; ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Unaligned fspacectl failed; errno=%d", errno); @@ -1143,7 +1143,7 @@ ATF_TC_BODY(fspacectl, tc) /* Aligned fspacectl(fd, SPACECTL_DEALLOC, ...) past shm_sz */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); range.r_offset = offset = page_size; - range.r_len = length = ((shm_max_pages + 1) * page_size) - offset; + range.r_len = length = (shm_max_pages + 1) * page_size - offset; ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Aligned fspacectl past shm_sz failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0, @@ -1152,7 +1152,7 @@ ATF_TC_BODY(fspacectl, tc) /* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) past shm_sz */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); range.r_offset = offset = page_size / 2; - range.r_len = length = ((shm_max_pages + 1) * page_size) - offset; + range.r_len = length = (shm_max_pages + 1) * page_size - offset; ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Unaligned fspacectl past shm_sz failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,