1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2022 Google, Inc.
4 * Written by Andrew Scull <ascull@google.com>
10 #include <linker_lists.h>
11 #include <linux/types.h>
14 * struct fuzz_test - Information about a fuzz test
16 * @name: Name of fuzz test
17 * @func: Function to call to perform fuzz test on an input
18 * @flags: Flags indicate pre-conditions for fuzz test
22 int (*func)(const uint8_t * data, size_t size);
27 * FUZZ_TEST() - register a fuzz test
29 * The fuzz test function must return 0 as other values are reserved for future
32 * @_name: the name of the fuzz test function
33 * @_flags: an integer field that can be evaluated by the fuzzer
36 #define FUZZ_TEST(_name, _flags) \
37 ll_entry_declare(struct fuzz_test, _name, fuzz_tests) = { \
43 /** Get the start of the list of fuzz tests */
44 #define FUZZ_TEST_START() \
45 ll_entry_start(struct fuzz_test, fuzz_tests)
47 /** Get the number of elements in the list of fuzz tests */
48 #define FUZZ_TEST_COUNT() \
49 ll_entry_count(struct fuzz_test, fuzz_tests)
51 #endif /* __TEST_FUZZ_H */