74 const char *expected ) {
94 tmp = &found_rev[
sizeof ( found_rev ) - 1 ];
98 if (
strcmp ( found, found_rev ) != 0 ) {
99 printf (
"FAILURE: list reversal mismatch (forward "
100 "\"%s\", reverse \"%s\")\n",
106 if (
strcmp ( found, expected ) == 0 ) {
109 printf (
"FAILURE: expected \"%s\", got \"%s\"\n",
122#define list_contents_ok( list, expected ) do { \
123 ok ( list_check_contents ( (list), (expected) ) ); \
134#define list_iterate_ok( macro, expected, pos, ... ) do { \
135 const char *check = expected; \
136 macro ( pos, __VA_ARGS__ ) { \
137 struct list_test *entry = \
138 list_entry ( pos, struct list_test, \
140 ok ( entry->label == *(check++) ); \
142 ok ( *check == '\0' ); \
153#define list_iterate_entry_ok( macro, expected, pos, ... ) do { \
154 const char *check = expected; \
155 macro ( pos, __VA_ARGS__ ) { \
156 ok ( (pos)->label == *(check++) ); \
158 ok ( *check == '\0' ); \
483 char *expected =
"241";
529 char *expecteds[] = {
"94257",
"9457",
"947",
"94" };
530 char **expected = expecteds;
541 char *expecteds[] = {
"94",
"4",
"" };
542 char **expected = expecteds;
#define NULL
NULL pointer (VOID *)
typeof(acpi_finder=acpi_find)
ACPI table finder.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define list_is_last_entry(entry, head, member)
Test if entry is last in a list.
#define list_cut_position(new, list, entry)
Cut a list into two.
#define list_contains_entry(entry, head, member)
Test if list contains a specified entry.
#define list_for_each_entry_continue_reverse(pos, head, member)
Iterate over entries in a list in reverse, starting after current position.
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
#define list_for_each_entry_safe_continue(pos, tmp, head, member)
Iterate over subsequent entries in a list, safe against deletion.
#define list_last_entry(list, type, member)
Get the container of the last entry in a list.
#define list_contains(entry, head)
Test if list contains a specified entry.
#define list_entry(list, type, member)
Get the container of a list entry.
#define list_splice(list, entry)
Move all entries from one list into another list.
#define list_splice_tail(list, entry)
Move all entries from one list into another list.
#define list_is_head_entry(entry, head, member)
Test if entry is the list head.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
#define list_prev_entry(pos, head, member)
Get the container of the previous entry in a list.
#define list_next_entry(pos, head, member)
Get the container of the next entry in a list.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
#define list_for_each_entry_continue(pos, head, member)
Iterate over entries in a list, starting after current position.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_splice_init(list, entry)
Move all entries from one list into another list and reinitialise empty list.
#define list_del(list)
Delete an entry from a list.
#define INIT_LIST_HEAD(list)
Initialise a list head.
#define list_for_each(pos, head)
Iterate over a list.
#define list_is_first_entry(entry, head, member)
Test if entry is first in a list.
#define list_empty(list)
Test whether a list is empty.
#define LIST_HEAD(list)
Declare a static list head.
#define list_for_each_entry_reverse(pos, head, member)
Iterate over entries in a list in reverse order.
#define list_is_singular(list)
Test whether a list has just one entry.
#define list_check_contains_entry(entry, head, member)
Check list contains a specified entry.
#define list_is_last(list, head)
Test whether an entry is the last entry in list.
#define list_add(new, head)
Add a new entry to the head of a list.
#define list_splice_tail_init(list, entry)
Move all entries from one list into another list and reinitialise empty list.
static struct list_test list_tests[]
List test elements.
#define list_contents_ok(list, expected)
Report list test result.
static int list_check_contents(struct list_head *list, const char *expected)
Check list contents are as expected.
#define list_iterate_ok(macro, expected, pos,...)
Report list iteration test result.
#define list_iterate_entry_ok(macro, expected, pos,...)
Report list entry iteration test result.
static void list_test_exec(void)
Perform list self-test.
int strcmp(const char *first, const char *second)
Compare strings.
A doubly-linked list entry (or list head)
struct list_head list
List element.
Self-test infrastructure.
#define __self_test
Declare a self-test.
int printf(const char *fmt,...)
Write a formatted string to the console.