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;
static struct list_test list_tests[]
List test elements.
int printf(const char *fmt,...)
Write a formatted string to the console.
#define list_add(new, head)
Add a new entry to the head of a list.
static LIST_HEAD(test_list)
Test list.
#define list_for_each_entry_continue(pos, head, member)
Iterate over entries in a list, starting after current position.
#define list_iterate_entry_ok(macro, expected, pos,...)
Report list entry iteration test result.
#define list_contents_ok(list, expected)
Report list test result.
#define list_next_entry(pos, head, member)
Get the container of the next entry in a list.
Self-test infrastructure.
#define list_for_each(pos, head)
Iterate over a list.
const char * name
Test set name.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define list_last_entry(list, type, member)
Get the container of the last entry in a list.
A doubly-linked list entry (or list head)
#define list_empty(list)
Test whether a list is empty.
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
static void list_test_exec(void)
Perform list self-test.
#define list_del(list)
Delete an entry from 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_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
#define list_for_each_entry_reverse(pos, head, member)
Iterate over entries in a list in reverse order.
static int list_check_contents(struct list_head *list, const char *expected)
Check list contents are as expected.
#define list_splice_init(list, entry)
Move all entries from one list into another list and reinitialise empty list.
#define list_contains_entry(entry, head, member)
Test if list contains a specified entry.
#define list_iterate_ok(macro, expected, pos,...)
Report list iteration test result.
#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_is_last_entry(entry, head, member)
Test if entry is last in a list.
#define list_splice_tail_init(list, entry)
Move all entries from one list into another list and reinitialise empty list.
#define list_prev_entry(pos, head, member)
Get the container of the previous entry in a list.
#define list_splice_tail(list, entry)
Move all entries from one list into another list.
#define list_is_first_entry(entry, head, member)
Test if entry is first in a list.
#define list_cut_position(new, list, entry)
Cut a list into two.
struct self_test list_test __self_test
List self-test.
#define list_for_each_entry_continue_reverse(pos, head, member)
Iterate over entries in a list in reverse, starting after current position.
#define INIT_LIST_HEAD(list)
Initialise a list head.
#define list_is_singular(list)
Test whether a list has just one entry.
struct list_head list
List element.
int strcmp(const char *first, const char *second)
Compare strings.
#define list_splice(list, entry)
Move all entries from one list into another list.
#define list_contains(entry, head)
Test if list contains a specified entry.
typeof(acpi_finder=acpi_find)
ACPI table finder.
#define list_check_contains_entry(entry, head, member)
Check list contains a specified entry.
#define list_entry(list, type, member)
Get the container of a list entry.
#define list_is_last(list, head)
Test whether an entry is the last entry in list.
#define NULL
NULL pointer (VOID *)
#define list_is_head_entry(entry, head, member)
Test if entry is the list head.
if(natsemi->flags &NATSEMI_64BIT) return 1