// SPDX-License-Identifier: GPL-2.0
/*
* KUnit test for the Kernel Linked-list structures.
*
* Copyright (C) 2019, Google LLC.
* Author: David Gow <davidgow@google.com>
*/
#include <kunit/test.h>
#include <linux/list.h>
#include <linux/klist.h>
struct list_test_struct {
int data;
struct list_head list;
};
static void list_test_list_init(struct kunit *test)
{
/* Test the different ways of initialising a list. */
struct list_head list1 = LIST_HEAD_INIT(list1);
struct list_head list2;
LIST_HEAD(list3);
struct list_head *list4;
struct list_head *list5;
INIT_LIST_HEAD(&list2);
list4 = kzalloc(sizeof(*list4), GFP_KERNEL | __GFP_NOFAIL);
INIT_LIST_HEAD(list4);
list5 = kmalloc(sizeof(