13 CONST CHAR16 *DevPathString;
67 CHAR8 HidStr[HID_STR_SIZE];
68 CHAR8 CidStr[CID_STR_SIZE];
69 CHAR8 UidStr[UID_STR_SIZE];
88 {
'P',
'N',
'P',
'B',
'0',
'C',
'0',
'\0' },
89 {
'P',
'N',
'P',
'0',
'0',
'0',
'1',
'\0' },
90 {
'U',
'I',
'D',
'0',
'0',
'0',
'0',
'\0' }
95 CHAR8 HidStr[HID_STR_SIZE];
113 {
'P',
'N',
'P',
'B',
'0',
'\0',
'\0',
'\0' },
118 CHAR8 UidStr[UID_STR_SIZE];
132 EISA_PNP_ID (0xAAAA),
136 {
'\0',
'U',
'I',
'D',
'0',
'0',
'\0',
'\0' }
150 EISA_PNP_ID (0xAAAA),
152 EISA_PNP_ID (0xAADD),
154 {
'\0',
'U',
'I',
'D',
'0',
'0',
'\0',
'\0' }
172 L
"AcpiEx(@@@0000,@@@0000,0x0,PNPB0C0,UID0000,PNP0001)"
176 L
"AcpiEx(@@@0000,@@@0000,0x2,PNPB0,,)"
180 L
"AcpiExp(PNPAAAA,0,UID00)"
184 L
"AcpiExp(PNPAAAA,PNPAADD,UID00)"
206 EISA_PNP_ID (0x0A03),
246 END_DEVICE_PATH_TYPE,
247 END_ENTIRE_DEVICE_PATH_SUBTYPE,
258 L
"PciRoot(0x0)/Pci(0x0,0x2)/Pci(0x0,0x0)/USB(0x0,0x2)"
264TestConvertDevicePathToText (
268 CHAR16 *DevPathString;
278 return UNIT_TEST_PASSED;
283TestConvertTextToDevicePath (
297 return UNIT_TEST_PASSED;
302TestConvertDeviceNodeToText (
306 CHAR16 *DevPathNodeString;
316 return UNIT_TEST_PASSED;
321TestConvertTextToDeviceNode (
335 return UNIT_TEST_PASSED;
339CreateDevicePathStringConversionsTestSuite (
340 IN UNIT_TEST_FRAMEWORK_HANDLE Framework
344 UNIT_TEST_SUITE_HANDLE DevicePathTextConversionSuite =
NULL;
347 Status =
CreateUnitTestSuite (&DevicePathTextConversionSuite, Framework,
"Device path text conversion operations test suite",
"Common.DevicePath.TextConversions",
NULL,
NULL);
348 if (EFI_ERROR (Status)) {
349 DEBUG ((DEBUG_ERROR,
"Failed to create device path text conversions test suite\n"));
353 for (Index = 0; Index <
ARRAY_SIZE (mDevPathNodeToFromTextContext); Index++) {
354 AddTestCase (DevicePathTextConversionSuite,
"Test ConvertDeviceNodeToText",
"TestConvertDeviceNodeToText", TestConvertDeviceNodeToText,
NULL,
NULL, &mDevPathNodeToFromTextContext[Index]);
357 for (Index = 0; Index <
ARRAY_SIZE (mDevPathNodeToFromTextContext); Index++) {
358 AddTestCase (DevicePathTextConversionSuite,
"Test ConvertTextToDeviceNode",
"TestConvertTextToDeviceNode", TestConvertTextToDeviceNode,
NULL,
NULL, &mDevPathNodeToFromTextContext[Index]);
361 for (Index = 0; Index <
ARRAY_SIZE (mDevPathToFromTextContext); Index++) {
362 AddTestCase (DevicePathTextConversionSuite,
"Test ConvertDevicePathToText",
"TestConvertDevicePathToText", TestConvertDevicePathToText,
NULL,
NULL, &mDevPathToFromTextContext[Index]);
365 for (Index = 0; Index <
ARRAY_SIZE (mDevPathToFromTextContext); Index++) {
366 AddTestCase (DevicePathTextConversionSuite,
"Test ConvertTextToDevicePath",
"TestConvertTextToDevicePath", TestConvertTextToDevicePath,
NULL,
NULL, &mDevPathToFromTextContext[Index]);
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
#define HARDWARE_DEVICE_PATH
#define MESSAGING_DEVICE_PATH
UINTN EFIAPI DevicePathNodeLength(IN CONST VOID *Node)
CHAR16 *EFIAPI ConvertDeviceNodeToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
CHAR16 *EFIAPI ConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
UINTN EFIAPI GetDevicePathSize(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI ConvertTextToDevicePath(IN CONST CHAR16 *TextDevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI ConvertTextToDeviceNode(IN CONST CHAR16 *TextDeviceNode)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ARRAY_SIZE(Array)
#define GLOBAL_REMOVE_IF_UNREFERENCED
#define DEBUG(Expression)
#define UT_ASSERT_MEM_EQUAL(BufferA, BufferB, Length)
#define UT_ASSERT_EQUAL(ValueA, ValueB)
EFI_STATUS EFIAPI CreateUnitTestSuite(OUT UNIT_TEST_SUITE_HANDLE *SuiteHandle, IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, IN CHAR8 *Title, IN CHAR8 *Name, IN UNIT_TEST_SUITE_SETUP Setup OPTIONAL, IN UNIT_TEST_SUITE_TEARDOWN Teardown OPTIONAL)
EFI_STATUS EFIAPI AddTestCase(IN UNIT_TEST_SUITE_HANDLE SuiteHandle, IN CHAR8 *Description, IN CHAR8 *Name, IN UNIT_TEST_FUNCTION Function, IN UNIT_TEST_PREREQUISITE Prerequisite OPTIONAL, IN UNIT_TEST_CLEANUP CleanUp OPTIONAL, IN UNIT_TEST_CONTEXT Context OPTIONAL)