iPXE
|
List function tests. More...
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <ipxe/list.h>
#include <ipxe/test.h>
Go to the source code of this file.
Data Structures | |
struct | list_test |
A list test structure. More... | |
Macros | |
#define | list_contents_ok(list, expected) |
Report list test result. More... | |
#define | list_iterate_ok(macro, expected, pos, ...) |
Report list iteration test result. More... | |
#define | list_iterate_entry_ok(macro, expected, pos, ...) |
Report list entry iteration test result. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static | LIST_HEAD (test_list) |
Test list. More... | |
static int | list_check_contents (struct list_head *list, const char *expected) |
Check list contents are as expected. More... | |
static void | list_test_exec (void) |
Perform list self-test. More... | |
Variables | |
static struct list_test | list_tests [] |
List test elements. More... | |
struct self_test list_test | __self_test |
List self-test. More... | |
List function tests.
Definition in file list_test.c.
#define list_contents_ok | ( | list, | |
expected | |||
) |
Report list test result.
list | Test list |
expected | Expected contents |
Definition at line 122 of file list_test.c.
#define list_iterate_ok | ( | macro, | |
expected, | |||
pos, | |||
... | |||
) |
Report list iteration test result.
macro | Iterator macro |
expected | Expected contents |
pos | Iterator |
... | Arguments to iterator macro |
Definition at line 134 of file list_test.c.
#define list_iterate_entry_ok | ( | macro, | |
expected, | |||
pos, | |||
... | |||
) |
Report list entry iteration test result.
macro | Iterator macro |
expected | Expected contents |
pos | Iterator |
... | Arguments to iterator macro |
Definition at line 153 of file list_test.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Test list.
|
static |
Check list contents are as expected.
list | Test list |
expected | Expected contents |
ok | List contents are as expected |
Definition at line 73 of file list_test.c.
References if(), list_test::label, list_test::list, list_for_each_entry, list_for_each_entry_reverse, num_entries, printf(), strcmp(), and tmp.
|
static |
Perform list self-test.
Definition at line 165 of file list_test.c.
References INIT_LIST_HEAD, list_test::list, list_add, list_add_tail, list_check_contains_entry, list_contains, list_contains_entry, list_contents_ok, list_cut_position, list_del, list_empty, list_entry, list_first_entry, list_for_each, list_for_each_entry, list_for_each_entry_continue, list_for_each_entry_continue_reverse, list_for_each_entry_reverse, list_for_each_entry_safe, list_for_each_entry_safe_continue, list_is_first_entry, list_is_head_entry, list_is_last, list_is_last_entry, list_is_singular, list_iterate_entry_ok, list_iterate_ok, list_last_entry, list_next_entry, list_prev_entry, list_splice, list_splice_init, list_splice_tail, list_splice_tail_init, list_tests, NULL, ok, tmp, and typeof().
|
static |
List test elements.
Definition at line 50 of file list_test.c.
Referenced by list_test_exec().
List self-test.
Definition at line 576 of file list_test.c.