mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
std.process: fix some page size assumptions in lockMemory/protectMemory tests
Makes the tests work on hexagon and loongarch.
This commit is contained in:
parent
9acfd167fa
commit
e8a6e58f9d
1 changed files with 6 additions and 7 deletions
|
|
@ -1066,10 +1066,11 @@ pub fn protectMemory(
|
|||
return error.UnsupportedOperation;
|
||||
}
|
||||
|
||||
var test_page: [std.heap.page_size_max]u8 align(std.heap.page_size_max) = undefined;
|
||||
|
||||
test lockMemory {
|
||||
var page: [std.heap.page_size_min]u8 align(std.heap.page_size_min) = undefined;
|
||||
lockMemory(&page, .{}) catch return error.SkipZigTest;
|
||||
unlockMemory(&page) catch return error.SkipZigTest;
|
||||
lockMemory(&test_page, .{}) catch return error.SkipZigTest;
|
||||
unlockMemory(&test_page) catch return error.SkipZigTest;
|
||||
}
|
||||
|
||||
test lockMemoryAll {
|
||||
|
|
@ -1078,8 +1079,6 @@ test lockMemoryAll {
|
|||
}
|
||||
|
||||
test protectMemory {
|
||||
if (builtin.cpu.arch == .hexagon) return error.SkipZigTest; // TODO
|
||||
var page: [std.heap.page_size_min]u8 align(std.heap.page_size_min) = undefined;
|
||||
protectMemory(&page, .{}) catch return error.SkipZigTest;
|
||||
protectMemory(&page, .{ .read = true, .write = true }) catch return error.SkipZigTest;
|
||||
protectMemory(&test_page, .{}) catch return error.SkipZigTest;
|
||||
protectMemory(&test_page, .{ .read = true, .write = true }) catch return error.SkipZigTest;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue