TianoCore EDK2 master
Loading...
Searching...
No Matches
CpuPageTableLibUnitTestHost.c File Reference

Go to the source code of this file.

Functions

UNIT_TEST_STATUS EFIAPI TestCaseForParameter (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCaseWhichNoNeedExtraSize (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCase1Gmapto4K (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCaseManualChangeReadWrite (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCaseManualSizeNotMatch (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCaseManualNotMergeEntry (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCaseManualChangeNx (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCaseToCheckMapMaskAndAttr (IN UNIT_TEST_CONTEXT Context)
 
EFI_STATUS EFIAPI UefiTestMain (VOID)
 
INT32 main (INT32 Argc, CHAR8 *Argv[])
 

Detailed Description

Unit tests of the CpuPageTableLib instance of the CpuPageTableLib class

Copyright (c) 2022 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CpuPageTableLibUnitTestHost.c.

Function Documentation

◆ main()

INT32 main ( INT32  Argc,
CHAR8 *  Argv[] 
)

Standard POSIX C entry point for host based unit test execution.

Parameters
ArgcNumber of arguments.
ArgvArray of arguments.
Returns
Test application exit code.

Definition at line 913 of file CpuPageTableLibUnitTestHost.c.

◆ TestCase1Gmapto4K()

UNIT_TEST_STATUS EFIAPI TestCase1Gmapto4K ( IN UNIT_TEST_CONTEXT  Context)

Test Case that check the case to map [0, 1G] to [8K, 1G+8K]

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 196 of file CpuPageTableLibUnitTestHost.c.

◆ TestCaseForParameter()

UNIT_TEST_STATUS EFIAPI TestCaseForParameter ( IN UNIT_TEST_CONTEXT  Context)

Check if the input parameters are not supported.

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 35 of file CpuPageTableLibUnitTestHost.c.

◆ TestCaseManualChangeNx()

UNIT_TEST_STATUS EFIAPI TestCaseManualChangeNx ( IN UNIT_TEST_CONTEXT  Context)

Check if the parent entry has different Nx attribute

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 592 of file CpuPageTableLibUnitTestHost.c.

◆ TestCaseManualChangeReadWrite()

UNIT_TEST_STATUS EFIAPI TestCaseManualChangeReadWrite ( IN UNIT_TEST_CONTEXT  Context)

Check if the parent entry has different R/W attribute

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 255 of file CpuPageTableLibUnitTestHost.c.

◆ TestCaseManualNotMergeEntry()

UNIT_TEST_STATUS EFIAPI TestCaseManualNotMergeEntry ( IN UNIT_TEST_CONTEXT  Context)

Check that won't merge entries

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 517 of file CpuPageTableLibUnitTestHost.c.

◆ TestCaseManualSizeNotMatch()

UNIT_TEST_STATUS EFIAPI TestCaseManualSizeNotMatch ( IN UNIT_TEST_CONTEXT  Context)

Check if the needed size is expected

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 410 of file CpuPageTableLibUnitTestHost.c.

◆ TestCaseToCheckMapMaskAndAttr()

UNIT_TEST_STATUS EFIAPI TestCaseToCheckMapMaskAndAttr ( IN UNIT_TEST_CONTEXT  Context)

Check if the input Mask and Attribute is as expected when creating new page table or updating existing page table.

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 717 of file CpuPageTableLibUnitTestHost.c.

◆ TestCaseWhichNoNeedExtraSize()

UNIT_TEST_STATUS EFIAPI TestCaseWhichNoNeedExtraSize ( IN UNIT_TEST_CONTEXT  Context)

Check the case that modifying page table doesn't need extra buffe

Parameters
[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.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 96 of file CpuPageTableLibUnitTestHost.c.

◆ UefiTestMain()

EFI_STATUS EFIAPI UefiTestMain ( VOID  )

Initialize the unit test framework, suite, and unit tests for the sample unit tests and run the unit tests.

Return values
EFI_SUCCESSAll test cases were dispatched.
EFI_OUT_OF_RESOURCESThere are not enough resources available to initialize the unit tests.

Definition at line 834 of file CpuPageTableLibUnitTestHost.c.