test_pat_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 <memory_manager/pat_x64.h>
27 
28 void
29 memory_manager_ut::test_pat_x64_mem_attr_to_pat_index()
30 {
37 
44 
45  this->expect_exception([&] { x64::pat::mem_attr_to_pat_index(9); }, ""_ut_ree);
46 }
#define expect_exception(f, e)
Definition: unittest.h:162
constexpr const auto uncacheable_minus_index
Definition: pat_x64.h:58
constexpr const auto write_through_index
Definition: pat_x64.h:55
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
auto mem_attr_to_pat_index(T attr)
Definition: pat_x64.h:61
constexpr const auto write_protected_index
Definition: pat_x64.h:56
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 uncacheable_index
Definition: pat_x64.h:53
constexpr const auto re_uc
Definition: mem_attr_x64.h:50
constexpr const auto rw_wc
Definition: mem_attr_x64.h:44
constexpr const auto write_back_index
Definition: pat_x64.h:57
constexpr const auto write_combining_index
Definition: pat_x64.h:54
constexpr const auto rw_wt
Definition: mem_attr_x64.h:45
constexpr const auto rw_wp
Definition: mem_attr_x64.h:46
constexpr const auto re_wb
Definition: mem_attr_x64.h:54
#define expect_true(a)