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

Go to the source code of this file.

Data Structures

struct  DEVICE_PATH_CONVERSIONS_TEST_CONTEXT
 
struct  ACPI_EXTENDED_HID_DEVICE_PATH_FULL
 
struct  ACPI_EXTENDED_HID_DEVICE_PATH_PARTIAL
 
struct  ACPI_EXPANDED_DEVICE_PATH
 
struct  TEST_CONVERSIONS_DEVICE_PATH
 

Macros

#define HID_STR_SIZE   8
 
#define CID_STR_SIZE   8
 
#define UID_STR_SIZE   8
 

Functions

UNIT_TEST_STATUS EFIAPI TestConvertDevicePathToText (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestConvertTextToDevicePath (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestConvertDeviceNodeToText (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestConvertTextToDeviceNode (IN UNIT_TEST_CONTEXT Context)
 
EFI_STATUS CreateDevicePathStringConversionsTestSuite (IN UNIT_TEST_FRAMEWORK_HANDLE Framework)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED PCI_DEVICE_PATH mPciDevicePathNode
 
GLOBAL_REMOVE_IF_UNREFERENCED ACPI_HID_DEVICE_PATH mAcpiPciRootHidDevicePathNode
 
GLOBAL_REMOVE_IF_UNREFERENCED ACPI_HID_DEVICE_PATH mAcpiNonPciRootHidDevicePathNode
 
GLOBAL_REMOVE_IF_UNREFERENCED ACPI_EXTENDED_HID_DEVICE_PATH_FULL mAcpiExtendedDevicePathFull
 
GLOBAL_REMOVE_IF_UNREFERENCED ACPI_EXTENDED_HID_DEVICE_PATH_PARTIAL mAcpiExtendedDevicePathPartial
 
GLOBAL_REMOVE_IF_UNREFERENCED ACPI_EXPANDED_DEVICE_PATH mAcpiExpandedDevicePathUidOnly
 
GLOBAL_REMOVE_IF_UNREFERENCED ACPI_EXPANDED_DEVICE_PATH mAcpiExpandedDevicePathUidOnlyWithCid
 
GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_CONVERSIONS_TEST_CONTEXT mDevPathNodeToFromTextContext []
 
GLOBAL_REMOVE_IF_UNREFERENCED TEST_CONVERSIONS_DEVICE_PATH mConversionsDevicePath
 
GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_CONVERSIONS_TEST_CONTEXT mDevPathToFromTextContext []
 

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 TestDevicePathStringConversions.c.

Macro Definition Documentation

◆ CID_STR_SIZE

#define CID_STR_SIZE   8

Definition at line 62 of file TestDevicePathStringConversions.c.

◆ HID_STR_SIZE

#define HID_STR_SIZE   8

Definition at line 61 of file TestDevicePathStringConversions.c.

◆ UID_STR_SIZE

#define UID_STR_SIZE   8

Definition at line 63 of file TestDevicePathStringConversions.c.

Function Documentation

◆ CreateDevicePathStringConversionsTestSuite()

EFI_STATUS CreateDevicePathStringConversionsTestSuite ( IN UNIT_TEST_FRAMEWORK_HANDLE  Framework)

Definition at line 339 of file TestDevicePathStringConversions.c.

◆ TestConvertDeviceNodeToText()

UNIT_TEST_STATUS EFIAPI TestConvertDeviceNodeToText ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 302 of file TestDevicePathStringConversions.c.

◆ TestConvertDevicePathToText()

UNIT_TEST_STATUS EFIAPI TestConvertDevicePathToText ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 264 of file TestDevicePathStringConversions.c.

◆ TestConvertTextToDeviceNode()

UNIT_TEST_STATUS EFIAPI TestConvertTextToDeviceNode ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 321 of file TestDevicePathStringConversions.c.

◆ TestConvertTextToDevicePath()

UNIT_TEST_STATUS EFIAPI TestConvertTextToDevicePath ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 283 of file TestDevicePathStringConversions.c.

Variable Documentation

◆ mAcpiExpandedDevicePathUidOnly

Initial value:
=
{
{
{
{
(UINT8)(sizeof (ACPI_EXPANDED_DEVICE_PATH)),
(UINT8)((sizeof (ACPI_EXPANDED_DEVICE_PATH)) >> 8)
}
},
EISA_PNP_ID (0xAAAA),
0,
0,
},
{ '\0', 'U', 'I', 'D', '0', '0', '\0', '\0' }
}
#define ACPI_DEVICE_PATH
Definition: DevicePath.h:190
#define ACPI_EXTENDED_DP
Definition: DevicePath.h:217

Definition at line 121 of file TestDevicePathStringConversions.c.

◆ mAcpiExpandedDevicePathUidOnlyWithCid

GLOBAL_REMOVE_IF_UNREFERENCED ACPI_EXPANDED_DEVICE_PATH mAcpiExpandedDevicePathUidOnlyWithCid
Initial value:
=
{
{
{
{
(UINT8)(sizeof (ACPI_EXPANDED_DEVICE_PATH)),
(UINT8)((sizeof (ACPI_EXPANDED_DEVICE_PATH)) >> 8)
}
},
EISA_PNP_ID (0xAAAA),
0,
EISA_PNP_ID (0xAADD),
},
{ '\0', 'U', 'I', 'D', '0', '0', '\0', '\0' }
}

Definition at line 139 of file TestDevicePathStringConversions.c.

◆ mAcpiExtendedDevicePathFull

Initial value:
=
{
{
{
{
(UINT8)((sizeof (ACPI_EXTENDED_HID_DEVICE_PATH_FULL)) >> 8)
}
},
0,
0,
0,
},
{ 'P', 'N', 'P', 'B', '0', 'C', '0', '\0' },
{ 'P', 'N', 'P', '0', '0', '0', '1', '\0' },
{ 'U', 'I', 'D', '0', '0', '0', '0', '\0' }
}

Definition at line 72 of file TestDevicePathStringConversions.c.

◆ mAcpiExtendedDevicePathPartial

Initial value:
=
{
{
{
{
(UINT8)((sizeof (ACPI_EXTENDED_HID_DEVICE_PATH_PARTIAL)) >> 8)
}
},
0,
2,
0,
},
{ 'P', 'N', 'P', 'B', '0', '\0', '\0', '\0' },
}

Definition at line 98 of file TestDevicePathStringConversions.c.

◆ mAcpiNonPciRootHidDevicePathNode

GLOBAL_REMOVE_IF_UNREFERENCED ACPI_HID_DEVICE_PATH mAcpiNonPciRootHidDevicePathNode
Initial value:
=
{
{
{
(UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),
(UINT8)((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
}
},
EISA_PNP_ID (0xB0C0),
1
}
#define ACPI_DP
Definition: DevicePath.h:195

Definition at line 46 of file TestDevicePathStringConversions.c.

◆ mAcpiPciRootHidDevicePathNode

GLOBAL_REMOVE_IF_UNREFERENCED ACPI_HID_DEVICE_PATH mAcpiPciRootHidDevicePathNode
Initial value:
=
{
{
{
(UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),
(UINT8)((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
}
},
EISA_PNP_ID (0x0A03),
0
}

Definition at line 31 of file TestDevicePathStringConversions.c.

◆ mConversionsDevicePath

◆ mDevPathNodeToFromTextContext

Initial value:
= {
{
(EFI_DEVICE_PATH_PROTOCOL *)&mPciDevicePathNode,
L"Pci(0x0,0x2)"
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&mAcpiPciRootHidDevicePathNode,
L"PciRoot(0x0)"
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&mAcpiNonPciRootHidDevicePathNode,
L"Acpi(PNPB0C0,0x1)"
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&mAcpiExtendedDevicePathFull,
L"AcpiEx(@@@0000,@@@0000,0x0,PNPB0C0,UID0000,PNP0001)"
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&mAcpiExtendedDevicePathPartial,
L"AcpiEx(@@@0000,@@@0000,0x2,PNPB0,,)"
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&mAcpiExpandedDevicePathUidOnly,
L"AcpiExp(PNPAAAA,0,UID00)"
},
{
(EFI_DEVICE_PATH_PROTOCOL *)&mAcpiExpandedDevicePathUidOnlyWithCid,
L"AcpiExp(PNPAAAA,PNPAADD,UID00)"
}
}

Definition at line 157 of file TestDevicePathStringConversions.c.

◆ mDevPathToFromTextContext

Initial value:
= {
{
(EFI_DEVICE_PATH_PROTOCOL *)&mConversionsDevicePath,
L"PciRoot(0x0)/Pci(0x0,0x2)/Pci(0x0,0x0)/USB(0x0,0x2)"
}
}

Definition at line 255 of file TestDevicePathStringConversions.c.

◆ mPciDevicePathNode

Initial value:
=
{
{
{
(UINT8)(sizeof (PCI_DEVICE_PATH)),
(UINT8)((sizeof (PCI_DEVICE_PATH)) >> 8)
}
},
0x2,
0x0
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_PCI_DP
Definition: DevicePath.h:73

Definition at line 16 of file TestDevicePathStringConversions.c.