git: 4b8feb5d61ac - main - tests: Handle platforms with MAXPAGESIZES < 2

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 23 Aug 2022 23:59:11 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=4b8feb5d61ace6d94cafb03288a53694e84c2e53

commit 4b8feb5d61ace6d94cafb03288a53694e84c2e53
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-08-23 23:48:06 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-08-23 23:48:06 +0000

    tests: Handle platforms with MAXPAGESIZES < 2
    
    Reported by:    Jenkins
    Fixes:          1dfa8b73f6a6 ("tests: Add more shared shadow regression tests")
---
 tests/sys/vm/shared_shadow_inval_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/sys/vm/shared_shadow_inval_test.c b/tests/sys/vm/shared_shadow_inval_test.c
index 8cd986b8ed99..c3a62296ffa4 100644
--- a/tests/sys/vm/shared_shadow_inval_test.c
+++ b/tests/sys/vm/shared_shadow_inval_test.c
@@ -365,7 +365,8 @@ do_shared_shadow_inval(bool lazy_cow)
 	ATF_REQUIRE(sysctllen >= sizeof(size_t));
 
 	pagesize = pagesizes[0];
-	largepagesize = sysctllen >= 2 * sizeof(size_t) && pagesizes[1] != 0 ?
+	largepagesize = MAXPAGESIZES >= 2 &&
+	    sysctllen >= 2 * sizeof(size_t) && pagesizes[1] != 0 ?
 	    pagesizes[1] : 2 * 1024 * 1024;
 
 	for (unsigned int i = 0; i <= FLAG_MASK; i++) {