summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorPeter Bindels <dascandy@gmail.com>2021-07-18 20:11:30 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-18 22:08:20 +0200
commitef85c4f7473e50c936a67a762c158833b9f0160a (patch)
tree840d1e072788c4759302fd32040ddc89fc0a224a /Tests
parente3b7ae0c77ba227f9fd666a7e9f7c5d9a5c6f402 (diff)
downloadserenity-ef85c4f7473e50c936a67a762c158833b9f0160a.zip
Tests: Make mmap test point to new kernel address too
During a recent commit the 64-bit kernel was moved to a different address, breaking this test (unnoticed). This fixes it, so we can turn on breaking x86_64 tests on the CI again.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Kernel/TestEFault.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Tests/Kernel/TestEFault.cpp b/Tests/Kernel/TestEFault.cpp
index 831f843cc1..9fd911f906 100644
--- a/Tests/Kernel/TestEFault.cpp
+++ b/Tests/Kernel/TestEFault.cpp
@@ -72,10 +72,12 @@ TEST_CASE(test_efault)
ptrdiff_t distance = two_page - one_page;
EXPECT_EFAULT(read, one_page, (u32)distance + 1024);
- // Test every kernel page just because.
- constexpr auto user_range_ceiling = 0xbe000000u;
+ constexpr auto user_range_ceiling = (sizeof(void*) == 4 ? 0xbe000000u : 0x1ffe000000);
u8* jerk_page = nullptr;
- for (u64 kernel_address = user_range_ceiling; kernel_address <= 0xffffffff; kernel_address += PAGE_SIZE) {
+
+ // Test every kernel page just because.
+ constexpr auto kernel_range_ceiling = (sizeof(void*) == 4 ? 0xffffffffu : 0x203fffffff);
+ for (u64 kernel_address = user_range_ceiling; kernel_address <= kernel_range_ceiling; kernel_address += PAGE_SIZE) {
jerk_page = (u8*)mmap((void*)kernel_address, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0);
EXPECT_EQ(jerk_page, MAP_FAILED);
EXPECT_EQ(errno, EFAULT);