linux/lib/test_printf.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Test cases for printf facility.
 */

#define pr_fmt(fmt)

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/printk.h>
#include <linux/random.h>
#include <linux/rtc.h>
#include <linux/slab.h>
#include <linux/sprintf.h>
#include <linux/string.h>

#include <linux/bitmap.h>
#include <linux/dcache.h>
#include <linux/socket.h>
#include <linux/in.h>

#include <linux/gfp.h>
#include <linux/mm.h>

#include <linux/property.h>

#include "../tools/testing/selftests/kselftest_module.h"

#define BUF_SIZE
#define PAD_SIZE
#define FILL_CHAR

#define NOWARN(option, comment, block)

KSTM_MODULE_GLOBALS();

static char *test_buffer __initdata;
static char *alloced_buffer __initdata;

static int __printf(4, 0) __init
do_test(int bufsize, const char *expect, int elen,
	const char *fmt, va_list ap)
{}

static void __printf(3, 4) __init
__test(const char *expect, int elen, const char *fmt, ...)
{}

#define test(expect, fmt, ...)

static void __init
test_basic(void)
{}

static void __init
test_number(void)
{}

static void __init
test_string(void)
{}

#define PLAIN_BUF_SIZE

#if BITS_PER_LONG == 64

#define PTR_WIDTH
#define PTR
#define PTR_STR
#define PTR_VAL_NO_CRNG
#define ZEROS
#define ONES

static int __init
plain_format(void)
{}

#else

#define PTR_WIDTH
#define PTR
#define PTR_STR
#define PTR_VAL_NO_CRNG
#define ZEROS
#define ONES

static int __init
plain_format(void)
{
	/* Format is implicitly tested for 32 bit machines by plain_hash() */
	return 0;
}

#endif	/* BITS_PER_LONG == 64 */

static int __init
plain_hash_to_buffer(const void *p, char *buf, size_t len)
{}

static int __init
plain_hash(void)
{}

/*
 * We can't use test() to test %p because we don't know what output to expect
 * after an address is hashed.
 */
static void __init
plain(void)
{}

static void __init
test_hashed(const char *fmt, const void *p)
{}

/*
 * NULL pointers aren't hashed.
 */
static void __init
null_pointer(void)
{}

/*
 * Error pointers aren't hashed.
 */
static void __init
error_pointer(void)
{}

#define PTR_INVALID

static void __init
invalid_pointer(void)
{}

static void __init
symbol_ptr(void)
{}

static void __init
kernel_ptr(void)
{}

static void __init
struct_resource(void)
{}

static void __init
addr(void)
{}

static void __init
escaped_str(void)
{}

static void __init
hex_string(void)
{}

static void __init
mac(void)
{}

static void __init
ip4(void)
{}

static void __init
ip6(void)
{}

static void __init
ip(void)
{}

static void __init
uuid(void)
{}

static struct dentry test_dentry[4] __initdata =;

static void __init
dentry(void)
{}

static void __init
struct_va_format(void)
{}

static void __init
time_and_date(void)
{}

static void __init
struct_clk(void)
{}

static void __init
large_bitmap(void)
{}

static void __init
bitmap(void)
{}

static void __init
netdev_features(void)
{}

struct page_flags_test {};

static const struct page_flags_test pft[] =;

static void __init
page_flags_test(int section, int node, int zone, int last_cpupid,
		int kasan_tag, unsigned long flags, const char *name,
		char *cmp_buf)
{}

static void __init page_type_test(unsigned int page_type, const char *name,
				  char *cmp_buf)
{}

static void __init
flags(void)
{}

static void __init fwnode_pointer(void)
{}

static void __init fourcc_pointer(void)
{}

static void __init
errptr(void)
{}

static void __init
test_pointer(void)
{}

static void __init selftest(void)
{}

KSTM_MODULE_LOADERS(test_printf);
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();