UEFIStarter
a simple UEFI framework
Data Structures | Macros | Functions | Variables

Tests for AC'97 functions. More...

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

Data Structures

struct  volume_macro_testcase_t
 data type for test_volume_macro() test cases More...
 

Macros

#define STRUCT_SIZE_TEST(NAME, SIZE)   assert_intn_equals(SIZE,sizeof(NAME),L"sizeof " #NAME);
 Shortcut macro: checks whether symbol has given size. More...
 

Functions

void test_struct_sizes ()
 Makes sure AC'97 built-in structures are sized correctly. More...
 
void test_volume_macro ()
 Makes sure ac97_mixer_value() works. More...
 
BOOLEAN run_ac97_tests ()
 Test runner for this group. More...
 

Variables

volume_macro_testcase_t volume_macro_testcases []
 test cases for test_volume_macro() More...
 

Detailed Description

Tests for AC'97 functions.

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

Macro Definition Documentation

◆ STRUCT_SIZE_TEST

#define STRUCT_SIZE_TEST (   NAME,
  SIZE 
)    assert_intn_equals(SIZE,sizeof(NAME),L"sizeof " #NAME);

Shortcut macro: checks whether symbol has given size.

Parameters
NAMEthe symbol's name
SIZEthe expected size, in bytes

Function Documentation

◆ test_struct_sizes()

void test_struct_sizes ( )

Makes sure AC'97 built-in structures are sized correctly.

Test:

ac97_bar_t's size is exactly 128 bytes, as required by AC'97 specs

ac97_buffer_descriptor_t's size is exactly 8 bytes, as required by AC'97 specs

ac97_busmaster_status_t's size is exactly 2 bytes, as required by AC'97 specs

◆ test_volume_macro()

void test_volume_macro ( )

Makes sure ac97_mixer_value() works.

Test:

ac97_mixer_value() handles left and right channel separately

ac97_mixer_value() converts mute value to 1 bit

◆ run_ac97_tests()

BOOLEAN run_ac97_tests ( )

Test runner for this group.

Gets called via the generated test runner.

Returns
whether the test group was executed

Variable Documentation

◆ volume_macro_testcases

volume_macro_testcase_t volume_macro_testcases[]
Initial value:
={
{0x8000,0,0,1},
{0x0000,0,0,0},
{0x0808,8,8,0},
{0x3F3F,0x3F,0x3F,0},
{0x9F12,0x1F,0x12,7}
}

test cases for test_volume_macro()