From 3a6b43cb320cdff0fcaac200be820f6e9a490a32 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Fri, 21 Oct 2022 01:35:28 -0700 Subject: [PATCH] [arch][mmu][tests] slight tweaks --- arch/test/mmu.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/test/mmu.cpp b/arch/test/mmu.cpp index 18dffb67..e6029117 100644 --- a/arch/test/mmu.cpp +++ b/arch/test/mmu.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -19,7 +20,7 @@ static bool create_user_aspace(void) { arch_aspace_t as; status_t err = arch_mmu_init_aspace(&as, USER_ASPACE_BASE, USER_ASPACE_SIZE, 0); - ASSERT_EQ(NO_ERROR, err, "init"); + ASSERT_EQ(NO_ERROR, err, "init aspace"); err = arch_mmu_destroy_aspace(&as); EXPECT_EQ(NO_ERROR, err, "destroy"); @@ -32,7 +33,7 @@ static bool map_user_pages(void) { arch_aspace_t as; status_t err = arch_mmu_init_aspace(&as, USER_ASPACE_BASE, USER_ASPACE_SIZE, 0); - ASSERT_EQ(NO_ERROR, err, "init"); + ASSERT_EQ(NO_ERROR, err, "init aspace"); auto aspace_cleanup = lk::make_auto_call([&]() { arch_mmu_destroy_aspace(&as); }); @@ -90,8 +91,8 @@ static bool map_region_query_result(vmm_aspace_t *aspace, uint arch_flags) { // query the page to see if it's realistic { - paddr_t pa; - uint flags; + paddr_t pa = 0; + uint flags = ~arch_flags; EXPECT_EQ(NO_ERROR, arch_mmu_query(&aspace->arch_aspace, (vaddr_t)ptr, &pa, &flags), "arch_query"); EXPECT_NE(0U, pa, "valid pa"); EXPECT_EQ(arch_flags, flags, "query flags"); @@ -138,7 +139,7 @@ static bool context_switch(void) { arch_aspace_t as; status_t err = arch_mmu_init_aspace(&as, USER_ASPACE_BASE, USER_ASPACE_SIZE, 0); - ASSERT_EQ(NO_ERROR, err, "init"); + ASSERT_EQ(NO_ERROR, err, "init aspace"); auto aspace_cleanup = lk::make_auto_call([&]() { arch_mmu_destroy_aspace(&as); }); // switch to the address space