summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-04-02 19:59:34 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-03 21:51:58 +0200
commit90a7b9e5b48c270aa5ca0b6aea361d29257d3925 (patch)
tree5b6b623a8d3e8fbcb2668efae1cba707a89dbea5 /Tests
parent2d3fb6ac3919186b146e7d83cdc23c68f7b61939 (diff)
downloadserenity-90a7b9e5b48c270aa5ca0b6aea361d29257d3925.zip
Tests: Make TestEFault not rely on automatic guard pages
I'm about to break automatic guard page allocation in sys$mmap(), so we need to fix this test to not rely on it.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Kernel/TestEFault.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/Kernel/TestEFault.cpp b/Tests/Kernel/TestEFault.cpp
index 1abd06490c..10be1719ec 100644
--- a/Tests/Kernel/TestEFault.cpp
+++ b/Tests/Kernel/TestEFault.cpp
@@ -48,6 +48,9 @@ TEST_CASE(test_efault)
EXPECT_EFAULT(read, one_page, 4097);
EXPECT_EFAULT(read, one_page - 1, 4096);
+ // Make an unused hole mapping to create some inaccessible distance between our one and two-page mappings.
+ (void)mmap(nullptr, 16384, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
+
// Test a two-page mapping (8KB)
u8* two_page = (u8*)mmap(nullptr, 8192, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
VERIFY(two_page);