UEFIStarter
a simple UEFI framework
Data Structures | Functions | Variables
pci.c File Reference

Tests for the PCI library functions. More...

#include <Uefi.h>
#include <Library/UefiLib.h>
#include <UEFIStarter/pci.h>
#include <UEFIStarter/tests/tests.h>

Data Structures

struct  pci_device_name_testcase_t
 data type for test_find_pci_device_name() testcases More...
 
struct  pci_class_name_testcase_t
 data type for test_find_pci_class_name() testcases More...
 

Functions

void test_find_pci_device_name ()
 Makes sure determining PCI device names works. More...
 
void test_find_pci_class_name ()
 Makes sure PCI class/subclass codes are mapped to names properly. More...
 
BOOLEAN run_pci_tests ()
 Test runner for this group. More...
 

Variables

pci_device_name_testcase_t pci_device_name_testcases []
 testcases for test_find_pci_device_name() More...
 
pci_class_name_testcase_t pci_class_name_testcases []
 testcases for test_find_pci_class_name() More...
 

Detailed Description

Tests for the PCI library functions.

Author
Richard Nusser
License
GPLv3 (see http://www.gnu.org/licenses/)
See also
https://github.com/rinusser/UEFIStarter

Function Documentation

◆ test_find_pci_device_name()

void test_find_pci_device_name ( )

Makes sure determining PCI device names works.

Test:

find_pci_device_name() finds entries with known vendor and device IDs

find_pci_device_name() finds known vendor entries and marks unknown device IDs

find_pci_device_name() marks unknown vendor IDs

find_pci_device_name() isn't affected by old strstr() bug

◆ test_find_pci_class_name()

void test_find_pci_class_name ( )

Makes sure PCI class/subclass codes are mapped to names properly.

Test:

find_pci_class_name() finds entries with known class and subclass codes

find_pci_class_name() finds entries with known class and marks unknown subclasses

find_pci_class_name() marks unknown entries as such

◆ run_pci_tests()

BOOLEAN run_pci_tests ( )

Test runner for this group.

Gets called via the generated test runner.

Returns
whether the test group was executed

Variable Documentation

◆ pci_device_name_testcases

pci_device_name_testcase_t pci_device_name_testcases[]
Initial value:
=
{
{0x106b,0x003f,L"Apple Inc., KeyLargo/Intrepid USB"},
{0x8086,0x2415,L"Intel Corporation, 82801AA AC'97 Audio Controller"},
{0x0000,0x0000,L"(unknown)"},
{0x8086,0x0000,L"Intel Corporation, unknown device"}
}

testcases for test_find_pci_device_name()

◆ pci_class_name_testcases

pci_class_name_testcase_t pci_class_name_testcases[]
Initial value:
=
{
{1, 6, L"Mass Storage Controller, SATA Controller"},
{4, 1, L"Multimedia, Audio Device"},
{4, 99,L"Multimedia, unknown"},
{99,0, L"unknown, unknown"},
}

testcases for test_find_pci_class_name()