linux/lib/checksum_kunit.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Test cases csum_partial, csum_fold, ip_fast_csum, csum_ipv6_magic
 */

#include <kunit/test.h>
#include <asm/checksum.h>
#include <net/ip6_checksum.h>

#define MAX_LEN
#define MAX_ALIGN
#define TEST_BUFLEN

#define IPv4_MIN_WORDS
#define IPv4_MAX_WORDS
#define NUM_IPv6_TESTS
#define NUM_IP_FAST_CSUM_TESTS

/* Values for a little endian CPU. Byte swap each half on big endian CPU. */
static const u32 random_init_sum =;
static const u8 random_buf[] =;

/* Values for a little endian CPU. Byte swap on big endian CPU. */
static const u16 expected_results[] =;

/* Values for a little endian CPU. Byte swap each half on big endian CPU. */
static const u32 init_sums_no_overflow[] =;

static const u16 expected_csum_ipv6_magic[] =;

static const u16 expected_fast_csum[] =;

static u8 tmp_buf[TEST_BUFLEN];

#define full_csum(buff, len, sum)

#define CHECK_EQ(lhs, rhs)

static __sum16 to_sum16(u16 x)
{}

/* This function swaps the bytes inside each half of a __wsum */
static __wsum to_wsum(u32 x)
{}

static void assert_setup_correct(struct kunit *test)
{}

/*
 * Test with randomized input (pre determined random with known results).
 */
static void test_csum_fixed_random_inputs(struct kunit *test)
{}

/*
 * All ones input test. If there are any missing carry operations, it fails.
 */
static void test_csum_all_carry_inputs(struct kunit *test)
{}

/*
 * Test with input that alone doesn't cause any carries. By selecting the
 * maximum initial sum, this allows us to test that there are no carries
 * where there shouldn't be.
 */
static void test_csum_no_carry_inputs(struct kunit *test)
{}

static void test_ip_fast_csum(struct kunit *test)
{}

static void test_csum_ipv6_magic(struct kunit *test)
{}

static struct kunit_case __refdata checksum_test_cases[] =;

static struct kunit_suite checksum_test_suite =;

kunit_test_suites();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();