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

Go to the source code of this file.

Data Structures

struct  TEST_COMPLEX_DEVICE_PATH
 
struct  TEST_SIMPLE_DEVICE_PATH
 
struct  SIMPLE_TEST_SUITE_CONTEXT
 

Macros

#define UNIT_TEST_NAME   "DevicePathLib Unit Test Application"
 
#define UNIT_TEST_VERSION   "0.1"
 

Functions

UNIT_TEST_STATUS EFIAPI TestIsDevicePathValid (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestDevicePathType (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestDevicePathSubType (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestDevicePathNodeLength (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestNextDevicePathNode (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestIsDevicePathEndType (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestIsDevicePathEnd (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestSetDevicePathNodeLength (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestSetDevicePathEndNode (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestGetDevicePathSize (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestDuplicateDevicePath (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestAppendDevicePath (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestAppendDevicePathNode (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestAppendDevicePathInstance (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestDevicePathFromHandle (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestCreateDeviceNode (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestFileDevicePath (IN UNIT_TEST_CONTEXT Context)
 
EFI_STATUS EFIAPI UefiTestMain (VOID)
 
int main (int argc, char *argv[])
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED TEST_COMPLEX_DEVICE_PATH mComplexDevicePath
 
CONST GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 * mComplexDevicePathString = L"PciRoot(0x0)/Pci(0x0,0x2)/Pci(0x0,0x0)/USB(0x0,0x2)"
 
CONST GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 * mPciEndPointPathString = L"Pci(0x0, 0x0)"
 
GLOBAL_REMOVE_IF_UNREFERENCED TEST_SIMPLE_DEVICE_PATH mSimpleDevicePath
 
GLOBAL_REMOVE_IF_UNREFERENCED TEST_SIMPLE_DEVICE_PATH mInvalidSimpleDevicePath
 

Detailed Description

UEFI OS based application for unit testing the DevicePathLib.

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

Definition in file TestDevicePathLib.c.

Macro Definition Documentation

◆ UNIT_TEST_NAME

#define UNIT_TEST_NAME   "DevicePathLib Unit Test Application"

Definition at line 10 of file TestDevicePathLib.c.

◆ UNIT_TEST_VERSION

#define UNIT_TEST_VERSION   "0.1"

Definition at line 11 of file TestDevicePathLib.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 630 of file TestDevicePathLib.c.

◆ TestAppendDevicePath()

UNIT_TEST_STATUS EFIAPI TestAppendDevicePath ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 380 of file TestDevicePathLib.c.

◆ TestAppendDevicePathInstance()

UNIT_TEST_STATUS EFIAPI TestAppendDevicePathInstance ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 450 of file TestDevicePathLib.c.

◆ TestAppendDevicePathNode()

UNIT_TEST_STATUS EFIAPI TestAppendDevicePathNode ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 407 of file TestDevicePathLib.c.

◆ TestCreateDeviceNode()

UNIT_TEST_STATUS EFIAPI TestCreateDeviceNode ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 506 of file TestDevicePathLib.c.

◆ TestDevicePathFromHandle()

UNIT_TEST_STATUS EFIAPI TestDevicePathFromHandle ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 485 of file TestDevicePathLib.c.

◆ TestDevicePathNodeLength()

UNIT_TEST_STATUS EFIAPI TestDevicePathNodeLength ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 225 of file TestDevicePathLib.c.

◆ TestDevicePathSubType()

UNIT_TEST_STATUS EFIAPI TestDevicePathSubType ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 203 of file TestDevicePathLib.c.

◆ TestDevicePathType()

UNIT_TEST_STATUS EFIAPI TestDevicePathType ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 181 of file TestDevicePathLib.c.

◆ TestDuplicateDevicePath()

UNIT_TEST_STATUS EFIAPI TestDuplicateDevicePath ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 361 of file TestDevicePathLib.c.

◆ TestFileDevicePath()

UNIT_TEST_STATUS EFIAPI TestFileDevicePath ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 522 of file TestDevicePathLib.c.

◆ TestGetDevicePathSize()

UNIT_TEST_STATUS EFIAPI TestGetDevicePathSize ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 341 of file TestDevicePathLib.c.

◆ TestIsDevicePathEnd()

UNIT_TEST_STATUS EFIAPI TestIsDevicePathEnd ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 288 of file TestDevicePathLib.c.

◆ TestIsDevicePathEndType()

UNIT_TEST_STATUS EFIAPI TestIsDevicePathEndType ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 268 of file TestDevicePathLib.c.

◆ TestIsDevicePathValid()

UNIT_TEST_STATUS EFIAPI TestIsDevicePathValid ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 143 of file TestDevicePathLib.c.

◆ TestNextDevicePathNode()

UNIT_TEST_STATUS EFIAPI TestNextDevicePathNode ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 247 of file TestDevicePathLib.c.

◆ TestSetDevicePathEndNode()

UNIT_TEST_STATUS EFIAPI TestSetDevicePathEndNode ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 325 of file TestDevicePathLib.c.

◆ TestSetDevicePathNodeLength()

UNIT_TEST_STATUS EFIAPI TestSetDevicePathNodeLength ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 308 of file TestDevicePathLib.c.

◆ UefiTestMain()

EFI_STATUS EFIAPI UefiTestMain ( VOID  )

Main fuction sets up the unit test environment

Definition at line 547 of file TestDevicePathLib.c.

Variable Documentation

◆ mComplexDevicePath

Definition at line 21 of file TestDevicePathLib.c.

◆ mComplexDevicePathString

CONST GLOBAL_REMOVE_IF_UNREFERENCED CHAR16* mComplexDevicePathString = L"PciRoot(0x0)/Pci(0x0,0x2)/Pci(0x0,0x0)/USB(0x0,0x2)"

Definition at line 80 of file TestDevicePathLib.c.

◆ mInvalidSimpleDevicePath

Initial value:
= {
{
{
{
0,
0
}
},
EISA_PNP_ID (0x0A03),
0
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
(UINT8)(sizeof (EFI_DEVICE_PATH_PROTOCOL)),
(UINT8)((sizeof (EFI_DEVICE_PATH_PROTOCOL)) >> 8)
}
}
}
#define ACPI_DEVICE_PATH
Definition: DevicePath.h:190
#define ACPI_DP
Definition: DevicePath.h:195

Definition at line 112 of file TestDevicePathLib.c.

◆ mPciEndPointPathString

CONST GLOBAL_REMOVE_IF_UNREFERENCED CHAR16* mPciEndPointPathString = L"Pci(0x0, 0x0)"

Definition at line 82 of file TestDevicePathLib.c.

◆ mSimpleDevicePath

Initial value:
= {
{
{
{
(UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),
(UINT8)((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
}
},
EISA_PNP_ID (0x0A03),
0
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
(UINT8)(sizeof (EFI_DEVICE_PATH_PROTOCOL)),
(UINT8)((sizeof (EFI_DEVICE_PATH_PROTOCOL)) >> 8)
}
}
}

Definition at line 89 of file TestDevicePathLib.c.