TianoCore EDK2 master
Loading...
Searching...
No Matches
CpuPageTableLibUnitTest.h
Go to the documentation of this file.
1
8#ifndef CPU_PAGE_TABLE_SUPPORT_H_
9#define CPU_PAGE_TABLE_SUPPORT_H_
10
11#include <stdio.h>
12#include <stdlib.h>
13#include <string.h>
14#include <stdarg.h>
15#include <stddef.h>
16#include <setjmp.h>
17#include <cmocka.h>
18#include <time.h>
19
20#include <Uefi.h>
21#include <Library/BaseLib.h>
23#include <Library/DebugLib.h>
24#include <Library/UnitTestLib.h>
29#include "../CpuPageTable.h"
30
31#define UNIT_TEST_APP_NAME "Cpu Page Table Lib Unit Tests"
32#define UNIT_TEST_APP_VERSION "1.0"
33
34//
35// Random Options
36//
37
38//
39// Only test one-one mapping case
40//
41#define ONLY_ONE_ONE_MAPPING 0x00000001
42
43//
44// Change page table without using function PageTableMap, and use the modified page table as input
45//
46#define MANUAL_CHANGE_PAGE_TABLE 0x00000002
47
48//
49// Use pre-generated random number array to generate random number
50//
51#define USE_RANDOM_ARRAY 0x00000004
52
53typedef struct {
54 PAGING_MODE PagingMode;
55 UINTN TestCount;
56 UINTN TestRangeCount;
57 UINTN RandomOption;
59
76EFIAPI
78 IN UNIT_TEST_CONTEXT Context
79 );
80
86VOID
88 UINTN MemorySpace
89 );
90
101 IN UINTN PageTable,
102 IN PAGING_MODE PagingMode
103 );
104
112UINT64
114 IN PAGING_MODE Mode
115 );
116
117#endif
UINT64 UINTN
UNIT_TEST_STATUS EFIAPI TestCaseforRandomTest(IN UNIT_TEST_CONTEXT Context)
Definition: RandomTest.c:1037
UNIT_TEST_STATUS IsPageTableValid(IN UINTN PageTable, IN PAGING_MODE PagingMode)
Definition: TestHelper.c:170
VOID InitGlobalData(UINTN MemorySpace)
Definition: TestHelper.c:31
UINT64 GetMaxAddress(IN PAGING_MODE Mode)
Definition: TestHelper.c:306
#define IN
Definition: Base.h:279
VOID * UNIT_TEST_CONTEXT
Definition: UnitTestLib.h:54
UINT32 UNIT_TEST_STATUS
Definition: UnitTestLib.h:16