diff --git a/Tests/Kernel/TestMunMap.cpp b/Tests/Kernel/TestMunMap.cpp new file mode 100644 index 0000000000..206c7c3556 --- /dev/null +++ b/Tests/Kernel/TestMunMap.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2021, Brian Gianforcaro + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include + +TEST_CASE(munmap_zero_page) +{ + // munmap of the unmapped zero page should always fail. + auto res = munmap(0x0, 0xF); + EXPECT_EQ(res, -1); + EXPECT_EQ(errno, EINVAL); +}