git: ee429a15e499 - stable/13 - posixshm tests: Correct page size index checks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 13 Mar 2023 15:53:23 UTC
The branch stable/13 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=ee429a15e49933e51d9c00a7e063815f59b4cc45
commit ee429a15e49933e51d9c00a7e063815f59b4cc45
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-03-03 16:16:21 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-03-13 15:53:16 +0000
posixshm tests: Correct page size index checks
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
(cherry picked from commit 560f9cd5e1e36ba725f3c677d7b8e514af9f3a85)
---
tests/sys/posixshm/posixshm_test.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c
index f0784f7b8769..50cba2cf7816 100644
--- a/tests/sys/posixshm/posixshm_test.c
+++ b/tests/sys/posixshm/posixshm_test.c
@@ -1092,7 +1092,8 @@ ATF_TC_BODY(largepage_basic, tc)
for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) {
ATF_REQUIRE_MSG((vec[p] & MINCORE_INCORE) != 0,
"page %zu is not mapped", p);
- ATF_REQUIRE_MSG((vec[p] & MINCORE_PSIND(i)) != 0,
+ ATF_REQUIRE_MSG((vec[p] & MINCORE_SUPER) ==
+ MINCORE_PSIND(i),
"page %zu is not in a %zu-byte superpage",
p, ps[i]);
}
@@ -1253,7 +1254,8 @@ ATF_TC_BODY(largepage_mmap, tc)
for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) {
ATF_REQUIRE_MSG((vec[p] & MINCORE_INCORE) != 0,
"page %zu is not resident", p);
- ATF_REQUIRE_MSG((vec[p] & MINCORE_PSIND(i)) != 0,
+ ATF_REQUIRE_MSG((vec[p] & MINCORE_SUPER) ==
+ MINCORE_PSIND(i),
"page %zu is not resident", p);
}
@@ -1588,7 +1590,7 @@ ATF_TC_BODY(largepage_minherit, tc)
*(volatile char *)addr = 0;
if (mincore(addr, PAGE_SIZE, &v) != 0)
_exit(1);
- if ((v & MINCORE_PSIND(i)) == 0)
+ if ((v & MINCORE_SUPER) == 0)
_exit(2);
_exit(0);
}
@@ -1737,7 +1739,7 @@ ATF_TC_BODY(largepage_reopen, tc)
ATF_REQUIRE(vec != NULL);
ATF_REQUIRE_MSG(mincore(addr, ps[psind], vec) == 0,
"mincore failed; error=%d", errno);
- ATF_REQUIRE_MSG((vec[0] & MINCORE_PSIND(psind)) != 0,
+ ATF_REQUIRE_MSG((vec[0] & MINCORE_SUPER) == MINCORE_PSIND(psind),
"page not mapped into a %zu-byte superpage", ps[psind]);
ATF_REQUIRE_MSG(shm_unlink(test_path) == 0,