test_mem_attr_x64.cpp
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22 #include <gsl/gsl>
23 
24 #include <test.h>
25 #include <intrinsics/x64.h>
27 
28 using namespace x64;
29 
30 void
31 memory_manager_ut::test_mem_attr_x64_mem_type_to_attr()
32 {
39 
46 
48  this->expect_exception([&] { memory_attr::mem_type_to_attr(memory_attr::rw, 9UL); }, ""_ut_ree);
49 }
#define expect_exception(f, e)
Definition: unittest.h:162
constexpr const auto re_wc
Definition: mem_attr_x64.h:51
constexpr const auto re_wp
Definition: mem_attr_x64.h:53
constexpr const auto re_uc_m
Definition: mem_attr_x64.h:55
constexpr const auto rw_uc_m
Definition: mem_attr_x64.h:48
constexpr const auto rw
Definition: mem_attr_x64.h:39
constexpr const auto re_wt
Definition: mem_attr_x64.h:52
constexpr const auto rw_wb
Definition: mem_attr_x64.h:47
constexpr const auto rw_uc
Definition: mem_attr_x64.h:43
constexpr const auto write_back
Definition: x64.h:46
constexpr const auto re_uc
Definition: mem_attr_x64.h:50
constexpr const auto uncacheable_minus
Definition: x64.h:47
constexpr const auto rw_wc
Definition: mem_attr_x64.h:44
constexpr const auto write_protected
Definition: x64.h:45
constexpr const auto uncacheable
Definition: x64.h:42
auto mem_type_to_attr(P perm, T type)
Definition: mem_attr_x64.h:67
constexpr const auto rw_wt
Definition: mem_attr_x64.h:45
Definition: cache_x64.h:31
constexpr const auto rw_wp
Definition: mem_attr_x64.h:46
constexpr const auto write_through
Definition: x64.h:44
constexpr const auto re_wb
Definition: mem_attr_x64.h:54
#define expect_true(a)
constexpr const auto write_combining
Definition: x64.h:43
constexpr const auto re
Definition: mem_attr_x64.h:40