linux/lib/kunit/assert_test.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * KUnit test for the assertion formatting functions.
 * Author: Ivan Orlov <[email protected]>
 */
#include <kunit/test.h>
#include "string-stream.h"

#define TEST_PTR_EXPECTED_BUF_SIZE
#define HEXDUMP_TEST_BUF_LEN
#define ASSERT_TEST_EXPECT_CONTAIN(test, str, substr)
#define ASSERT_TEST_EXPECT_NCONTAIN(test, str, substr)

static void kunit_test_is_literal(struct kunit *test)
{}

static void kunit_test_is_str_literal(struct kunit *test)
{}

KUNIT_DEFINE_ACTION_WRAPPER(kfree_wrapper, kfree, const void *);

/* this function is used to get a "char *" string from the string stream and defer its cleanup  */
static char *get_str_from_stream(struct kunit *test, struct string_stream *stream)
{}

static void kunit_test_assert_prologue(struct kunit *test)
{}

/*
 * This function accepts an arbitrary count of parameters and generates a va_format struct,
 * which can be used to validate kunit_assert_print_msg function
 */
static void verify_assert_print_msg(struct kunit *test,
				    struct string_stream *stream,
				    char *expected, const char *format, ...)
{}

static void kunit_test_assert_print_msg(struct kunit *test)
{}

/*
 * Further code contains the tests for different assert format functions.
 * This helper function accepts the assert format function, executes it and
 * validates the result string from the stream by checking that all of the
 * substrings exist in the output.
 */
static void validate_assert(assert_format_t format_func, struct kunit *test,
			    const struct kunit_assert *assert,
			    struct string_stream *stream, int num_checks, ...)
{}

static void kunit_test_unary_assert_format(struct kunit *test)
{}

static void kunit_test_ptr_not_err_assert_format(struct kunit *test)
{}

static void kunit_test_binary_assert_format(struct kunit *test)
{}

static void kunit_test_binary_ptr_assert_format(struct kunit *test)
{}

static void kunit_test_binary_str_assert_format(struct kunit *test)
{}

static const u8 hex_testbuf1[] =;
static const u8 hex_testbuf2[] =;
static void kunit_test_assert_hexdump(struct kunit *test)
{}

static void kunit_test_mem_assert_format(struct kunit *test)
{}

static struct kunit_case assert_test_cases[] =;

static struct kunit_suite assert_test_suite =;

kunit_test_suites();