UEFIStarter
a simple UEFI framework
|
Tests for the logging facility. More...
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <UEFIStarter/core.h>
#include <UEFIStarter/tests/tests.h>
Macros | |
#define | LOG_COUNT_ENTRIES 6 |
The number of entries in the log counter array. More... | |
Functions | |
static void | _reset_log_counts () |
Reset's the log message counters to 0. | |
static void | _counting_logger (LOGLEVEL level, CHAR16 *msg) |
A (mostly silent) log printer: instead of showing messages somewhere it just counts how many log entries were generated at which log level. More... | |
static void | _assert_log_counts (UINTN error, UINTN warn, UINTN info, UINTN debug, UINTN trace) |
Assertion for log counters. More... | |
void | test_logger () |
Makes sure the log level threshold works. More... | |
BOOLEAN | run_logger_tests () |
Test runner for this group. More... | |
Variables | |
static UINTN | _log_counts [LOG_COUNT_ENTRIES] |
Internal storage for the _counting_logger() function. More... | |
Tests for the logging facility.
#define LOG_COUNT_ENTRIES 6 |
The number of entries in the log counter array.
Index is of type LOGLEVEL: "OFF" is 0, "TRACE" starts at 1, so we need to reserve the index 0 entry.
|
static |
A (mostly silent) log printer: instead of showing messages somewhere it just counts how many log entries were generated at which log level.
level | the entry's log level |
msg | the entry's log message |
|
static |
Assertion for log counters.
Compares all counters to expected values.
error | the expected number of entries at level ERROR |
warn | the expected number of entries at level WARN |
info | the expected number of entries at level INFO |
debug | the expected number of entries at level DEBUG |
trace | the expected number of entries at level TRACE |
void test_logger | ( | ) |
Makes sure the log level threshold works.
a log event at the current log level should be printed
a log event above the current log level should be printed
a log event below the current log level should be ignored
when the current log level is OFF all log events should be ignored
BOOLEAN run_logger_tests | ( | ) |
Test runner for this group.
Gets called via the generated test runner.
|
static |
Internal storage for the _counting_logger() function.
Contains the number of entries issued per log level.