UEFIStarter
a simple UEFI framework
Functions
asserts.c File Reference

Self-tests for assertions. More...

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

Functions

void test_boolean ()
 Makes sure the boolean assertions work. More...
 
void test_integer ()
 Makes sure the integer comparison assertions work. More...
 
void test_double ()
 Makes sure the double comparison assertions work. More...
 
void test_compounds ()
 Makes sure the compound assertions work. More...
 
void test_graphics ()
 Makes sure the pixel assertions work. More...
 
BOOLEAN run_asserts_tests ()
 Test runner for this group. More...
 

Detailed Description

Self-tests for assertions.

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

Function Documentation

◆ test_boolean()

void test_boolean ( )

Makes sure the boolean assertions work.

Test:
assert_true() and assert_false() check C-style truthy values and can be inverted

◆ test_integer()

void test_integer ( )

Makes sure the integer comparison assertions work.

Test:

assert_intn_equals() asserts actual == expected and can be inverted

assert_intn_greater_than_or_equal_to() asserts actual >= expected and can be inverted

assert_intn_less_than_or_equal_to() asserts actual <= expected and can be inverted

assert_intn_in_closed_interval() asserts expected_lower <= actual <= expected_upper and can be inverted

◆ test_double()

void test_double ( )

Makes sure the double comparison assertions work.

Test:

assert_double_near() asserts expected-epsilon <= actual <= expected+epsilon and can be inverted

assert_double_greater_than() asserts actual > expected and can be inverted

assert_double_greater_than_or_equal_to() asserts actual >= expected and can be inverted

◆ test_compounds()

void test_compounds ( )

Makes sure the compound assertions work.

Test:
assert_null() and assert_not_null() check for NULL values and can be inverted.

◆ test_graphics()

void test_graphics ( )

Makes sure the pixel assertions work.

Test:

assert_pixel() asserts pixel values match exactly and can be inverted

assert_pixel_near() asserts the sum of absolute differences between actual and expected pixels' channels is <=epsilon and can be inverted

Todo:
move this to the graphics tests, once they're in this repository

◆ run_asserts_tests()

BOOLEAN run_asserts_tests ( )

Test runner for this group.

Gets called via the generated test runner.

Returns
whether the test group was executed