mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
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.
This commit is contained in:
parent
2d3fb6ac39
commit
90a7b9e5b4
Notes:
sideshowbarker
2024-07-17 14:31:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/90a7b9e5b4
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue