TianoCore EDK2 master
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <time.h>
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/UnitTestLib.h>
#include <Library/CpuPageTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UnitTestHostBaseLib.h>
#include <Library/BaseCryptLib.h>
#include "../CpuPageTable.h"
Go to the source code of this file.
Data Structures | |
struct | CPU_PAGE_TABLE_LIB_RANDOM_TEST_CONTEXT |
Macros | |
#define | UNIT_TEST_APP_NAME "Cpu Page Table Lib Unit Tests" |
#define | UNIT_TEST_APP_VERSION "1.0" |
#define | ONLY_ONE_ONE_MAPPING 0x00000001 |
#define | MANUAL_CHANGE_PAGE_TABLE 0x00000002 |
#define | USE_RANDOM_ARRAY 0x00000004 |
Functions | |
UNIT_TEST_STATUS EFIAPI | TestCaseforRandomTest (IN UNIT_TEST_CONTEXT Context) |
VOID | InitGlobalData (UINTN MemorySpace) |
UNIT_TEST_STATUS | IsPageTableValid (IN UINTN PageTable, IN PAGING_MODE PagingMode) |
UINT64 | GetMaxAddress (IN PAGING_MODE Mode) |
Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CpuPageTableLibUnitTest.h.
#define MANUAL_CHANGE_PAGE_TABLE 0x00000002 |
Definition at line 46 of file CpuPageTableLibUnitTest.h.
#define ONLY_ONE_ONE_MAPPING 0x00000001 |
Definition at line 41 of file CpuPageTableLibUnitTest.h.
#define UNIT_TEST_APP_NAME "Cpu Page Table Lib Unit Tests" |
Definition at line 31 of file CpuPageTableLibUnitTest.h.
#define UNIT_TEST_APP_VERSION "1.0" |
Definition at line 32 of file CpuPageTableLibUnitTest.h.
#define USE_RANDOM_ARRAY 0x00000004 |
Definition at line 51 of file CpuPageTableLibUnitTest.h.
UINT64 GetMaxAddress | ( | IN PAGING_MODE | PagingMode | ) |
Get max physical adrress supported by specific page mode
[in] | Mode | The paging mode. |
max | address. |
Get max physical address supported by specific page mode
[in] | PagingMode | The paging mode. |
Max | Address. |
Definition at line 306 of file TestHelper.c.
VOID InitGlobalData | ( | UINTN | MemorySpace | ) |
Init global data
[in] | MemorySpace | Memory space |
Init global data.
[in] | MemorySpace | Memory space |
Definition at line 31 of file TestHelper.c.
UNIT_TEST_STATUS IsPageTableValid | ( | IN UINTN | PageTable, |
IN PAGING_MODE | PagingMode | ||
) |
Check if the Page table is valid
[in] | PageTable | The pointer to the page table. |
[in] | PagingMode | The paging mode. |
UNIT_TEST_PASSED | It is a valid Page Table |
Definition at line 170 of file TestHelper.c.
UNIT_TEST_STATUS EFIAPI TestCaseforRandomTest | ( | IN UNIT_TEST_CONTEXT | Context | ) |
Random Test
[in] | Context | [Optional] An optional parameter that enables: 1) test-case reuse with varied parameters and 2) test-case re-entry for Target tests that need a reboot. This parameter is a VOID* and it is the responsibility of the test author to ensure that the contents are well understood by all test cases that may consume it. |
UNIT_TEST_PASSED | The Unit test has completed and the test case was successful. |
UNIT_TEST_ERROR_TEST_FAILED | A test case assertion has failed. |
Definition at line 1037 of file RandomTest.c.