#define pr_fmt(fmt) …
#include <kunit/test.h>
#include <linux/array_size.h>
#include <linux/kernel.h>
#include <linux/random.h>
#include <linux/string.h>
#include <linux/string_helpers.h>
static void test_string_check_buf(struct kunit *test,
const char *name, unsigned int flags,
char *in, size_t p,
char *out_real, size_t q_real,
char *out_test, size_t q_test)
{ … }
struct test_string { … };
static const struct test_string strings[] = …;
static void test_string_unescape(struct kunit *test,
const char *name, unsigned int flags,
bool inplace)
{ … }
struct test_string_1 { … };
#define TEST_STRING_2_MAX_S1 …
struct test_string_2 { … };
#define TEST_STRING_2_DICT_0 …
static const struct test_string_2 escape0[] = …;
#define TEST_STRING_2_DICT_1 …
static const struct test_string_2 escape1[] = …;
static const struct test_string strings_upper[] = …;
static const struct test_string strings_lower[] = …;
static const char *test_string_find_match(const struct test_string_2 *s2,
unsigned int flags)
{ … }
static void
test_string_escape_overflow(struct kunit *test,
const char *in, int p, unsigned int flags, const char *esc,
int q_test, const char *name)
{ … }
static void test_string_escape(struct kunit *test, const char *name,
const struct test_string_2 *s2,
unsigned int flags, const char *esc)
{ … }
#define string_get_size_maxbuf …
#define test_string_get_size_one(size, blk_size, exp_result10, exp_result2) …
static void test_string_get_size_check(struct kunit *test,
const char *units,
const char *exp,
char *res,
const u64 size,
const u64 blk_size)
{ … }
static void __strchrcut(char *dst, const char *src, const char *cut)
{ … }
static void __test_string_get_size_one(struct kunit *test,
const u64 size, const u64 blk_size,
const char *exp_result10,
const char *exp_result2,
enum string_size_units units,
const char *cut)
{ … }
static void __test_string_get_size(struct kunit *test,
const u64 size, const u64 blk_size,
const char *exp_result10,
const char *exp_result2)
{ … }
static void test_get_size(struct kunit *test)
{ … }
static void test_upper_lower(struct kunit *test)
{ … }
static void test_unescape(struct kunit *test)
{ … }
static struct kunit_case string_helpers_test_cases[] = …;
static struct kunit_suite string_helpers_test_suite = …;
kunit_test_suites(…);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;